{"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","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-07-28T13:39:49.636514Z","iopub.execute_input":"2022-07-28T13:39:49.636945Z","iopub.status.idle":"2022-07-28T13:39:49.643825Z","shell.execute_reply.started":"2022-07-28T13:39:49.636911Z","shell.execute_reply":"2022-07-28T13:39:49.64221Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        #print(os.path.join(dirname, filename))\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":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"folder_count = 0  # type: int\n\ninput_path = \"../input/osic-pulmonary-fibrosis-progression/train\"  # type: str\nfor folders in os.listdir(input_path):\n    folder_count += 1  # increment counter\n\nprint(\"There are {0} folders\".format(folder_count))","metadata":{"execution":{"iopub.status.busy":"2022-07-28T13:51:36.762703Z","iopub.execute_input":"2022-07-28T13:51:36.763084Z","iopub.status.idle":"2022-07-28T13:51:36.772127Z","shell.execute_reply.started":"2022-07-28T13:51:36.763055Z","shell.execute_reply":"2022-07-28T13:51:36.770888Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Create dataframe with columns \"title\" and \"text\"\ndf = pd.read_csv(f\"../input/osic-pulmonary-fibrosis-progression/train.csv\", sep=\",\")\nlen(df)\ndf.head()","metadata":{"execution":{"iopub.status.busy":"2022-07-28T13:45:29.880394Z","iopub.execute_input":"2022-07-28T13:45:29.880918Z","iopub.status.idle":"2022-07-28T13:45:29.903781Z","shell.execute_reply.started":"2022-07-28T13:45:29.880872Z","shell.execute_reply":"2022-07-28T13:45:29.902724Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(df)","metadata":{"execution":{"iopub.status.busy":"2022-07-28T13:48:02.030539Z","iopub.execute_input":"2022-07-28T13:48:02.031516Z","iopub.status.idle":"2022-07-28T13:48:02.038091Z","shell.execute_reply.started":"2022-07-28T13:48:02.031454Z","shell.execute_reply":"2022-07-28T13:48:02.036978Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(df.nunique())","metadata":{"execution":{"iopub.status.busy":"2022-07-28T13:47:10.728726Z","iopub.execute_input":"2022-07-28T13:47:10.729119Z","iopub.status.idle":"2022-07-28T13:47:10.743341Z","shell.execute_reply.started":"2022-07-28T13:47:10.729089Z","shell.execute_reply":"2022-07-28T13:47:10.741738Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import seaborn as sns\nimport matplotlib.pyplot as plt","metadata":{"execution":{"iopub.status.busy":"2022-07-28T14:44:54.00324Z","iopub.execute_input":"2022-07-28T14:44:54.003695Z","iopub.status.idle":"2022-07-28T14:44:54.009345Z","shell.execute_reply.started":"2022-07-28T14:44:54.003659Z","shell.execute_reply":"2022-07-28T14:44:54.007817Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.displot(df, x=\"FVC\")\nplt.savefig('FVC_plot.png')","metadata":{"execution":{"iopub.status.busy":"2022-07-28T14:44:55.826073Z","iopub.execute_input":"2022-07-28T14:44:55.826813Z","iopub.status.idle":"2022-07-28T14:44:56.173398Z","shell.execute_reply.started":"2022-07-28T14:44:55.826766Z","shell.execute_reply":"2022-07-28T14:44:56.171676Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.displot(df, x=\"SmokingStatus\", shrink=.5)\nplt.savefig('smoking_stat.png')","metadata":{"execution":{"iopub.status.busy":"2022-07-28T14:47:38.309601Z","iopub.execute_input":"2022-07-28T14:47:38.309972Z","iopub.status.idle":"2022-07-28T14:47:38.594838Z","shell.execute_reply.started":"2022-07-28T14:47:38.309943Z","shell.execute_reply":"2022-07-28T14:47:38.593726Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.displot(df, x=\"Weeks\")\nplt.savefig('weeks.png')","metadata":{"execution":{"iopub.status.busy":"2022-07-28T14:47:50.451743Z","iopub.execute_input":"2022-07-28T14:47:50.452167Z","iopub.status.idle":"2022-07-28T14:47:50.870097Z","shell.execute_reply.started":"2022-07-28T14:47:50.452134Z","shell.execute_reply":"2022-07-28T14:47:50.868755Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.pairplot(df)\nplt.savefig('all.png')","metadata":{"execution":{"iopub.status.busy":"2022-07-28T14:47:54.930162Z","iopub.execute_input":"2022-07-28T14:47:54.930662Z","iopub.status.idle":"2022-07-28T14:47:59.288327Z","shell.execute_reply.started":"2022-07-28T14:47:54.930625Z","shell.execute_reply":"2022-07-28T14:47:59.287212Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}