{"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":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport random\nimport cv2","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-10-22T10:17:03.303434Z","iopub.execute_input":"2021-10-22T10:17:03.303934Z","iopub.status.idle":"2021-10-22T10:17:03.481370Z","shell.execute_reply.started":"2021-10-22T10:17:03.303844Z","shell.execute_reply":"2021-10-22T10:17:03.480540Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"PATH = '../input/aptos2019-blindness-detection/'\nPATH_IMG = '../input/aptos2019-blindness-detection/train_images/'","metadata":{"execution":{"iopub.status.busy":"2021-10-22T10:17:03.482879Z","iopub.execute_input":"2021-10-22T10:17:03.483101Z","iopub.status.idle":"2021-10-22T10:17:03.487209Z","shell.execute_reply.started":"2021-10-22T10:17:03.483073Z","shell.execute_reply":"2021-10-22T10:17:03.486192Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv(f'{PATH}train.csv')\ndf.head()","metadata":{"execution":{"iopub.status.busy":"2021-10-22T10:17:03.488680Z","iopub.execute_input":"2021-10-22T10:17:03.489045Z","iopub.status.idle":"2021-10-22T10:17:03.532431Z","shell.execute_reply.started":"2021-10-22T10:17:03.489015Z","shell.execute_reply":"2021-10-22T10:17:03.531605Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.shape","metadata":{"execution":{"iopub.status.busy":"2021-10-22T10:17:03.534863Z","iopub.execute_input":"2021-10-22T10:17:03.535422Z","iopub.status.idle":"2021-10-22T10:17:03.542440Z","shell.execute_reply.started":"2021-10-22T10:17:03.535375Z","shell.execute_reply":"2021-10-22T10:17:03.541503Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.diagnosis.hist()","metadata":{"execution":{"iopub.status.busy":"2021-10-22T10:17:03.543958Z","iopub.execute_input":"2021-10-22T10:17:03.544294Z","iopub.status.idle":"2021-10-22T10:17:03.816731Z","shell.execute_reply.started":"2021-10-22T10:17:03.544250Z","shell.execute_reply":"2021-10-22T10:17:03.815845Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def get_images(diagnosis):\n    fig, ax = plt.subplots(1,3,figsize=(15, 15))\n    for i in range(3):\n        id = random.choice(df.loc[df['diagnosis'] == diagnosis].id_code.reset_index(drop=True))\n        img = cv2.imread(f'{PATH_IMG}{id}.png')[...,[2,1,0]]\n        ax[i].set_title(f'Диагноз {str(diagnosis)}')\n        ax[i].imshow(img)\n    plt.show()\n","metadata":{"execution":{"iopub.status.busy":"2021-10-22T10:17:03.818174Z","iopub.execute_input":"2021-10-22T10:17:03.818665Z","iopub.status.idle":"2021-10-22T10:17:03.825460Z","shell.execute_reply.started":"2021-10-22T10:17:03.818618Z","shell.execute_reply":"2021-10-22T10:17:03.824890Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"get_images(0)\nget_images(1)\nget_images(2)\nget_images(3)","metadata":{"execution":{"iopub.status.busy":"2021-10-22T10:17:03.826426Z","iopub.execute_input":"2021-10-22T10:17:03.827236Z","iopub.status.idle":"2021-10-22T10:17:14.867367Z","shell.execute_reply.started":"2021-10-22T10:17:03.827203Z","shell.execute_reply":"2021-10-22T10:17:14.866723Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}