{"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)\nimport glob\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\n'''\nfor 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-08-23T10:35:35.239078Z","iopub.execute_input":"2021-08-23T10:35:35.239526Z","iopub.status.idle":"2021-08-23T10:35:35.25619Z","shell.execute_reply.started":"2021-08-23T10:35:35.239439Z","shell.execute_reply":"2021-08-23T10:35:35.254985Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submissionDF01 = pd.read_csv('../input/miccai-testsubmissions/testPredictions_all.csv', dtype=str)\nsubmissionDF01 = submissionDF01.set_index('BraTS21ID')\nscoreDict01 = submissionDF01['MGMT_value'].to_dict()\nprint(scoreDict01)","metadata":{"execution":{"iopub.status.busy":"2021-08-23T10:35:50.264887Z","iopub.execute_input":"2021-08-23T10:35:50.265405Z","iopub.status.idle":"2021-08-23T10:35:50.283279Z","shell.execute_reply.started":"2021-08-23T10:35:50.265373Z","shell.execute_reply":"2021-08-23T10:35:50.282241Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#submissionDF02 = pd.read_csv('../input/miccai-testsubmissions/submission02.csv', dtype=str)\n#submissionDF02 = submissionDF02.set_index('BraTS21ID')\n#scoreDict02 = submissionDF02['MGMT_value'].to_dict()\n#print(scoreDict02)","metadata":{"execution":{"iopub.status.busy":"2021-08-23T10:35:53.695034Z","iopub.execute_input":"2021-08-23T10:35:53.695404Z","iopub.status.idle":"2021-08-23T10:35:53.709195Z","shell.execute_reply.started":"2021-08-23T10:35:53.695369Z","shell.execute_reply":"2021-08-23T10:35:53.708016Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"listOfStudyPaths = glob.glob('../input/rsna-miccai-brain-tumor-radiogenomic-classification/test/*')\nlistOfStudies = [eachPath.split('/')[-1] for eachPath in listOfStudyPaths]\n\npredList = []\nfor eachStudy in listOfStudies:\n    if eachStudy not in scoreDict01:\n        predList.append('0.500')\n    else:\n        score = float(scoreDict01[eachStudy])\n        predList.append(score)\n        \nsubmissionDF = pd.DataFrame({'BraTS21ID':listOfStudies,'MGMT_value':predList})\nsubmissionDF.to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2021-08-23T10:37:27.729634Z","iopub.execute_input":"2021-08-23T10:37:27.729991Z","iopub.status.idle":"2021-08-23T10:37:27.745431Z","shell.execute_reply.started":"2021-08-23T10:37:27.729963Z","shell.execute_reply":"2021-08-23T10:37:27.744308Z"},"trusted":true},"execution_count":null,"outputs":[]}]}