{"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\nfor 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":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-01-08T18:20:39.126851Z","iopub.execute_input":"2023-01-08T18:20:39.127211Z","iopub.status.idle":"2023-01-08T18:21:13.039342Z","shell.execute_reply.started":"2023-01-08T18:20:39.127176Z","shell.execute_reply":"2023-01-08T18:21:13.038448Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **import libararies**","metadata":{}},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd","metadata":{"execution":{"iopub.status.busy":"2023-01-14T05:15:36.540811Z","iopub.execute_input":"2023-01-14T05:15:36.541189Z","iopub.status.idle":"2023-01-14T05:15:36.547315Z","shell.execute_reply.started":"2023-01-14T05:15:36.541158Z","shell.execute_reply":"2023-01-14T05:15:36.545712Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Import data**","metadata":{}},{"cell_type":"code","source":"data=pd.read_csv('/kaggle/input/rsna-breast-cancer-detection/train.csv')","metadata":{"execution":{"iopub.status.busy":"2023-01-14T04:54:25.996326Z","iopub.execute_input":"2023-01-14T04:54:25.996751Z","iopub.status.idle":"2023-01-14T04:54:26.077792Z","shell.execute_reply.started":"2023-01-14T04:54:25.996712Z","shell.execute_reply":"2023-01-14T04:54:26.076115Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Data Shape**","metadata":{}},{"cell_type":"code","source":"data.shape","metadata":{"execution":{"iopub.status.busy":"2023-01-14T04:54:31.835695Z","iopub.execute_input":"2023-01-14T04:54:31.836178Z","iopub.status.idle":"2023-01-14T04:54:31.845026Z","shell.execute_reply.started":"2023-01-14T04:54:31.836142Z","shell.execute_reply":"2023-01-14T04:54:31.843398Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data.head(5)","metadata":{"execution":{"iopub.status.busy":"2023-01-14T04:54:33.608482Z","iopub.execute_input":"2023-01-14T04:54:33.608999Z","iopub.status.idle":"2023-01-14T04:54:33.626744Z","shell.execute_reply.started":"2023-01-14T04:54:33.608964Z","shell.execute_reply":"2023-01-14T04:54:33.625822Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data","metadata":{"execution":{"iopub.status.busy":"2023-01-14T04:54:35.690732Z","iopub.execute_input":"2023-01-14T04:54:35.691407Z","iopub.status.idle":"2023-01-14T04:54:35.717214Z","shell.execute_reply.started":"2023-01-14T04:54:35.691362Z","shell.execute_reply":"2023-01-14T04:54:35.71586Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Handling Missing Values **","metadata":{}},{"cell_type":"code","source":"data.isnull()","metadata":{"execution":{"iopub.status.busy":"2023-01-14T04:54:38.870367Z","iopub.execute_input":"2023-01-14T04:54:38.870892Z","iopub.status.idle":"2023-01-14T04:54:38.909678Z","shell.execute_reply.started":"2023-01-14T04:54:38.870854Z","shell.execute_reply":"2023-01-14T04:54:38.908346Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2023-01-14T04:54:42.917392Z","iopub.execute_input":"2023-01-14T04:54:42.917888Z","iopub.status.idle":"2023-01-14T04:54:42.941115Z","shell.execute_reply.started":"2023-01-14T04:54:42.917838Z","shell.execute_reply":"2023-01-14T04:54:42.939711Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data.isnull().sum().sum()","metadata":{"execution":{"iopub.status.busy":"2023-01-14T04:54:45.663992Z","iopub.execute_input":"2023-01-14T04:54:45.66446Z","iopub.status.idle":"2023-01-14T04:54:45.686283Z","shell.execute_reply.started":"2023-01-14T04:54:45.664422Z","shell.execute_reply":"2023-01-14T04:54:45.684649Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Filling Nan Values with the next value **","metadata":{}},{"cell_type":"code","source":"data1=data.fillna(method='bfill' )","metadata":{"execution":{"iopub.status.busy":"2023-01-14T04:54:47.534969Z","iopub.execute_input":"2023-01-14T04:54:47.535499Z","iopub.status.idle":"2023-01-14T04:54:47.553753Z","shell.execute_reply.started":"2023-01-14T04:54:47.535455Z","shell.execute_reply":"2023-01-14T04:54:47.552086Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data1","metadata":{"execution":{"iopub.status.busy":"2023-01-14T04:54:49.087761Z","iopub.execute_input":"2023-01-14T04:54:49.088207Z","iopub.status.idle":"2023-01-14T04:54:49.120314Z","shell.execute_reply.started":"2023-01-14T04:54:49.088174Z","shell.execute_reply":"2023-01-14T04:54:49.118907Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data1.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2023-01-14T04:54:52.710017Z","iopub.execute_input":"2023-01-14T04:54:52.710415Z","iopub.status.idle":"2023-01-14T04:54:52.731249Z","shell.execute_reply.started":"2023-01-14T04:54:52.710383Z","shell.execute_reply":"2023-01-14T04:54:52.72962Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import csv","metadata":{"execution":{"iopub.status.busy":"2023-01-14T04:57:52.157843Z","iopub.execute_input":"2023-01-14T04:57:52.158301Z","iopub.status.idle":"2023-01-14T04:57:52.164669Z","shell.execute_reply.started":"2023-01-14T04:57:52.158269Z","shell.execute_reply":"2023-01-14T04:57:52.163241Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"file = open('data1.csv', 'w')","metadata":{"execution":{"iopub.status.busy":"2023-01-14T05:04:17.737332Z","iopub.execute_input":"2023-01-14T05:04:17.737762Z","iopub.status.idle":"2023-01-14T05:04:17.743149Z","shell.execute_reply.started":"2023-01-14T05:04:17.737729Z","shell.execute_reply":"2023-01-14T05:04:17.742239Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"writer = csv.writer(file)","metadata":{"execution":{"iopub.status.busy":"2023-01-14T05:04:35.628643Z","iopub.execute_input":"2023-01-14T05:04:35.629063Z","iopub.status.idle":"2023-01-14T05:04:35.634574Z","shell.execute_reply.started":"2023-01-14T05:04:35.629031Z","shell.execute_reply":"2023-01-14T05:04:35.633249Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"writer.writerow(data1)","metadata":{"execution":{"iopub.status.busy":"2023-01-14T05:05:10.961571Z","iopub.execute_input":"2023-01-14T05:05:10.962039Z","iopub.status.idle":"2023-01-14T05:05:10.970346Z","shell.execute_reply.started":"2023-01-14T05:05:10.962004Z","shell.execute_reply":"2023-01-14T05:05:10.969046Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data1","metadata":{"execution":{"iopub.status.busy":"2023-01-14T05:16:10.244181Z","iopub.execute_input":"2023-01-14T05:16:10.24546Z","iopub.status.idle":"2023-01-14T05:16:10.273555Z","shell.execute_reply.started":"2023-01-14T05:16:10.245403Z","shell.execute_reply":"2023-01-14T05:16:10.272032Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data1.to_csv('submission.csv')","metadata":{"execution":{"iopub.status.busy":"2023-01-14T05:20:17.363158Z","iopub.execute_input":"2023-01-14T05:20:17.363574Z","iopub.status.idle":"2023-01-14T05:20:17.608811Z","shell.execute_reply.started":"2023-01-14T05:20:17.363541Z","shell.execute_reply":"2023-01-14T05:20:17.607891Z"},"trusted":true},"execution_count":null,"outputs":[]}]}