{"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":"\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","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-08-04T18:27:16.838676Z","iopub.execute_input":"2021-08-04T18:27:16.83925Z","iopub.status.idle":"2021-08-04T18:27:16.850105Z","shell.execute_reply.started":"2021-08-04T18:27:16.839165Z","shell.execute_reply":"2021-08-04T18:27:16.849194Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tiko=pd.read_csv('../input/chest-xray-csv/chest_csv')","metadata":{"execution":{"iopub.status.busy":"2021-08-04T18:28:24.366779Z","iopub.execute_input":"2021-08-04T18:28:24.367134Z","iopub.status.idle":"2021-08-04T18:28:24.65401Z","shell.execute_reply.started":"2021-08-04T18:28:24.367104Z","shell.execute_reply":"2021-08-04T18:28:24.653256Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"adnane=pd.read_csv('../input/d/kheyduzoomryou/chest-xray-csv/final.csv')","metadata":{"execution":{"iopub.status.busy":"2021-08-04T18:29:51.032588Z","iopub.execute_input":"2021-08-04T18:29:51.032933Z","iopub.status.idle":"2021-08-04T18:29:51.386827Z","shell.execute_reply.started":"2021-08-04T18:29:51.032905Z","shell.execute_reply":"2021-08-04T18:29:51.38591Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"adnane","metadata":{"execution":{"iopub.status.busy":"2021-08-04T18:29:55.4548Z","iopub.execute_input":"2021-08-04T18:29:55.455139Z","iopub.status.idle":"2021-08-04T18:29:55.530243Z","shell.execute_reply.started":"2021-08-04T18:29:55.455112Z","shell.execute_reply":"2021-08-04T18:29:55.529234Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tiko","metadata":{"execution":{"iopub.status.busy":"2021-08-04T18:28:26.340059Z","iopub.execute_input":"2021-08-04T18:28:26.340471Z","iopub.status.idle":"2021-08-04T18:28:26.382105Z","shell.execute_reply.started":"2021-08-04T18:28:26.340409Z","shell.execute_reply":"2021-08-04T18:28:26.381065Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"txt = \"welcome to. the jungle\"\n\nx = txt.split('.')","metadata":{"execution":{"iopub.status.busy":"2021-08-04T18:30:31.555452Z","iopub.execute_input":"2021-08-04T18:30:31.55578Z","iopub.status.idle":"2021-08-04T18:30:31.559768Z","shell.execute_reply.started":"2021-08-04T18:30:31.555752Z","shell.execute_reply":"2021-08-04T18:30:31.55873Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"txt.split('.')[0]","metadata":{"execution":{"iopub.status.busy":"2021-08-04T18:30:33.909594Z","iopub.execute_input":"2021-08-04T18:30:33.910131Z","iopub.status.idle":"2021-08-04T18:30:33.91561Z","shell.execute_reply.started":"2021-08-04T18:30:33.910098Z","shell.execute_reply":"2021-08-04T18:30:33.914769Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x","metadata":{"execution":{"iopub.status.busy":"2021-08-04T18:30:38.904283Z","iopub.execute_input":"2021-08-04T18:30:38.904787Z","iopub.status.idle":"2021-08-04T18:30:38.910369Z","shell.execute_reply.started":"2021-08-04T18:30:38.904755Z","shell.execute_reply":"2021-08-04T18:30:38.90929Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.DataFrame()\nfilenames = []\ndirectory = []\nlabel = []\nfor filename in os.listdir('../input/new-pneumonia'):\n    x=filename.split('.')[0]\n    filenames.append(x)\n    label.append('Pneumonia')\ndf['image_id'] = filenames\ndf['class_name'] = label\n\n\ndf1 = pd.DataFrame()\nfilenames1 = []\ndirectory1 = []\nlabel1 = []\nfor filename1 in os.listdir('../input/pneumothorax-new'):\n    x=filename1.split('.')[0]\n    filenames1.append(x)\n    label1.append('Pneumothorax')\ndf1['image_id'] = filenames1\ndf1['class_name'] = label1\n\ndf2 = pd.DataFrame()\nfilenames2 = []\ndirectory2 = []\nlabel2 = []\nfor filename2 in os.listdir('../input/edema-2020/Edema'):\n    x=filename2.split('.')[0]\n    filenames2.append(x)\n    label2.append('Edema')\ndf2['image_id'] = filenames2\ndf2['class_name'] = label2\n\n\ndf3 = pd.DataFrame()\nfilenames3 = []\ndirectory3 = []\nlabel3 = []\nfor filename3 in os.listdir('../input/atelectasis/Atelectasis'):\n    x=filename3.split('.')[0]\n    filenames3.append(x)\n    label3.append('Atelectasis')\ndf3['image_id'] = filenames3\ndf3['class_name'] = label3\n\n","metadata":{"execution":{"iopub.status.busy":"2021-08-04T16:52:55.777475Z","iopub.execute_input":"2021-08-04T16:52:55.777924Z","iopub.status.idle":"2021-08-04T16:52:56.540572Z","shell.execute_reply.started":"2021-08-04T16:52:55.777887Z","shell.execute_reply":"2021-08-04T16:52:56.53954Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df2","metadata":{"execution":{"iopub.status.busy":"2021-08-04T16:53:04.485545Z","iopub.execute_input":"2021-08-04T16:53:04.485928Z","iopub.status.idle":"2021-08-04T16:53:04.500943Z","shell.execute_reply.started":"2021-08-04T16:53:04.485886Z","shell.execute_reply":"2021-08-04T16:53:04.499829Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1","metadata":{"execution":{"iopub.status.busy":"2021-08-04T16:53:08.20118Z","iopub.execute_input":"2021-08-04T16:53:08.201557Z","iopub.status.idle":"2021-08-04T16:53:08.215431Z","shell.execute_reply.started":"2021-08-04T16:53:08.201526Z","shell.execute_reply":"2021-08-04T16:53:08.214344Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df","metadata":{"execution":{"iopub.status.busy":"2021-08-04T16:53:12.888374Z","iopub.execute_input":"2021-08-04T16:53:12.888717Z","iopub.status.idle":"2021-08-04T16:53:12.903869Z","shell.execute_reply.started":"2021-08-04T16:53:12.888689Z","shell.execute_reply":"2021-08-04T16:53:12.902562Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"frames = [tiko,df,df1,df2,df3]\nresult = pd.concat(frames)","metadata":{"execution":{"iopub.status.busy":"2021-08-04T16:53:53.73128Z","iopub.execute_input":"2021-08-04T16:53:53.731648Z","iopub.status.idle":"2021-08-04T16:53:53.750628Z","shell.execute_reply.started":"2021-08-04T16:53:53.731611Z","shell.execute_reply":"2021-08-04T16:53:53.749571Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"result=result.reset_index(drop=True)","metadata":{"execution":{"iopub.status.busy":"2021-08-04T16:53:59.165088Z","iopub.execute_input":"2021-08-04T16:53:59.16548Z","iopub.status.idle":"2021-08-04T16:53:59.177278Z","shell.execute_reply.started":"2021-08-04T16:53:59.165447Z","shell.execute_reply":"2021-08-04T16:53:59.176218Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"result","metadata":{"execution":{"iopub.status.busy":"2021-08-04T16:54:02.125206Z","iopub.execute_input":"2021-08-04T16:54:02.125565Z","iopub.status.idle":"2021-08-04T16:54:02.154197Z","shell.execute_reply.started":"2021-08-04T16:54:02.125538Z","shell.execute_reply":"2021-08-04T16:54:02.153208Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(result)","metadata":{"execution":{"iopub.status.busy":"2021-08-04T16:54:12.480563Z","iopub.execute_input":"2021-08-04T16:54:12.480937Z","iopub.status.idle":"2021-08-04T16:54:12.487216Z","shell.execute_reply.started":"2021-08-04T16:54:12.480907Z","shell.execute_reply":"2021-08-04T16:54:12.486127Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"result.to_csv(r'chest_xray.csv')","metadata":{"execution":{"iopub.status.busy":"2021-08-04T16:54:17.476351Z","iopub.execute_input":"2021-08-04T16:54:17.476713Z","iopub.status.idle":"2021-08-04T16:54:18.215546Z","shell.execute_reply.started":"2021-08-04T16:54:17.476684Z","shell.execute_reply":"2021-08-04T16:54:18.214666Z"},"trusted":true},"execution_count":null,"outputs":[]}]}