{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\n#for dirname, _, filenames in os.walk('/kaggle/input'):\n#    for filename in filenames:\n#        print(os.path.join(dirname, filename))\n\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-07-22T12:34:18.291976Z","iopub.execute_input":"2021-07-22T12:34:18.292359Z","iopub.status.idle":"2021-07-22T12:34:18.297769Z","shell.execute_reply.started":"2021-07-22T12:34:18.292325Z","shell.execute_reply":"2021-07-22T12:34:18.296622Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# READ SIMPLE_SUBMISSION FILE","metadata":{}},{"cell_type":"code","source":"sample_submission=pd.read_csv('../input/rsna-miccai-brain-tumor-radiogenomic-classification/sample_submission.csv')\nsample_submission.head(5)","metadata":{"execution":{"iopub.status.busy":"2021-07-22T12:34:22.008344Z","iopub.execute_input":"2021-07-22T12:34:22.008799Z","iopub.status.idle":"2021-07-22T12:34:22.141859Z","shell.execute_reply.started":"2021-07-22T12:34:22.008761Z","shell.execute_reply":"2021-07-22T12:34:22.140761Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_labels=pd.read_csv('../input/rsna-miccai-brain-tumor-radiogenomic-classification/train_labels.csv')\ntrain_labels.head(5)","metadata":{"execution":{"iopub.status.busy":"2021-07-22T12:34:24.429307Z","iopub.execute_input":"2021-07-22T12:34:24.429716Z","iopub.status.idle":"2021-07-22T12:34:24.448001Z","shell.execute_reply.started":"2021-07-22T12:34:24.429682Z","shell.execute_reply":"2021-07-22T12:34:24.446753Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"## ADD Column with id folder and path folder\ndef prepare(df):\n    \n    df['id_folder']=['{0:05d}'.format(id) for id in df['BraTS21ID']]\n    Path_folder='../input/rsna-miccai-brain-tumor-radiogenomic-classification/train'\n    for id in df['id_folder']:\n        df['folder_path']=Path_folder+id\n    \n    return df\n    \n\n","metadata":{"execution":{"iopub.status.busy":"2021-07-22T12:34:26.647699Z","iopub.execute_input":"2021-07-22T12:34:26.648059Z","iopub.status.idle":"2021-07-22T12:34:26.65399Z","shell.execute_reply.started":"2021-07-22T12:34:26.648028Z","shell.execute_reply":"2021-07-22T12:34:26.652766Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df=prepare(train_labels)\ndf.head(5)","metadata":{"execution":{"iopub.status.busy":"2021-07-22T12:34:29.06217Z","iopub.execute_input":"2021-07-22T12:34:29.06275Z","iopub.status.idle":"2021-07-22T12:34:29.141363Z","shell.execute_reply.started":"2021-07-22T12:34:29.062701Z","shell.execute_reply":"2021-07-22T12:34:29.140163Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def getFromFolder(i):\n    x = pd.read_csv(df[\"folder_path\"][0])\n    return x\nprint(getFromFolder(0))","metadata":{"execution":{"iopub.status.busy":"2021-07-22T12:52:21.897348Z","iopub.execute_input":"2021-07-22T12:52:21.897743Z","iopub.status.idle":"2021-07-22T12:52:21.944515Z","shell.execute_reply.started":"2021-07-22T12:52:21.897707Z","shell.execute_reply":"2021-07-22T12:52:21.941998Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2021-07-22T12:49:16.135551Z","iopub.execute_input":"2021-07-22T12:49:16.136067Z","iopub.status.idle":"2021-07-22T12:49:16.142099Z","shell.execute_reply.started":"2021-07-22T12:49:16.136033Z","shell.execute_reply":"2021-07-22T12:49:16.140976Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}