{"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":"markdown","source":"First we call the libraries that we will work on","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np \nimport seaborn as sns\nimport matplotlib.pyplot as plt\n%matplotlib inline\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:14.762555Z","iopub.execute_input":"2023-04-15T12:31:14.763390Z","iopub.status.idle":"2023-04-15T12:31:15.802097Z","shell.execute_reply.started":"2023-04-15T12:31:14.763280Z","shell.execute_reply":"2023-04-15T12:31:15.801208Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"We are reading files","metadata":{}},{"cell_type":"code","source":"df=pd.read_csv('../input/AI4Code/sample_submission.csv')","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:15.805910Z","iopub.execute_input":"2023-04-15T12:31:15.806237Z","iopub.status.idle":"2023-04-15T12:31:15.823224Z","shell.execute_reply.started":"2023-04-15T12:31:15.806208Z","shell.execute_reply":"2023-04-15T12:31:15.822308Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1=pd.read_csv('../input/AI4Code/train_orders.csv')","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:15.824565Z","iopub.execute_input":"2023-04-15T12:31:15.825250Z","iopub.status.idle":"2023-04-15T12:31:17.888830Z","shell.execute_reply.started":"2023-04-15T12:31:15.825207Z","shell.execute_reply":"2023-04-15T12:31:17.887703Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df2=pd.read_csv('../input/AI4Code/train_ancestors.csv')","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:17.891989Z","iopub.execute_input":"2023-04-15T12:31:17.892485Z","iopub.status.idle":"2023-04-15T12:31:18.182648Z","shell.execute_reply.started":"2023-04-15T12:31:17.892429Z","shell.execute_reply":"2023-04-15T12:31:18.181393Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"We read the first rows","metadata":{}},{"cell_type":"code","source":"df.head()\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.185479Z","iopub.execute_input":"2023-04-15T12:31:18.186440Z","iopub.status.idle":"2023-04-15T12:31:18.206689Z","shell.execute_reply.started":"2023-04-15T12:31:18.186399Z","shell.execute_reply":"2023-04-15T12:31:18.205427Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.head()\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.208299Z","iopub.execute_input":"2023-04-15T12:31:18.208650Z","iopub.status.idle":"2023-04-15T12:31:18.221850Z","shell.execute_reply.started":"2023-04-15T12:31:18.208618Z","shell.execute_reply":"2023-04-15T12:31:18.220491Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df2.head()\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.223559Z","iopub.execute_input":"2023-04-15T12:31:18.224238Z","iopub.status.idle":"2023-04-15T12:31:18.240668Z","shell.execute_reply.started":"2023-04-15T12:31:18.224195Z","shell.execute_reply":"2023-04-15T12:31:18.239389Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"We review the data","metadata":{}},{"cell_type":"code","source":"df.shape\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.242377Z","iopub.execute_input":"2023-04-15T12:31:18.243204Z","iopub.status.idle":"2023-04-15T12:31:18.254122Z","shell.execute_reply.started":"2023-04-15T12:31:18.243167Z","shell.execute_reply":"2023-04-15T12:31:18.252886Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.shape\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.255993Z","iopub.execute_input":"2023-04-15T12:31:18.257089Z","iopub.status.idle":"2023-04-15T12:31:18.265258Z","shell.execute_reply.started":"2023-04-15T12:31:18.257010Z","shell.execute_reply":"2023-04-15T12:31:18.264440Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df2.shape\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.269700Z","iopub.execute_input":"2023-04-15T12:31:18.270505Z","iopub.status.idle":"2023-04-15T12:31:18.277969Z","shell.execute_reply.started":"2023-04-15T12:31:18.270459Z","shell.execute_reply":"2023-04-15T12:31:18.276881Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"We review the quality of the data","metadata":{}},{"cell_type":"code","source":"df.dtypes\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.279462Z","iopub.execute_input":"2023-04-15T12:31:18.280274Z","iopub.status.idle":"2023-04-15T12:31:18.290757Z","shell.execute_reply.started":"2023-04-15T12:31:18.280231Z","shell.execute_reply":"2023-04-15T12:31:18.289620Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.dtypes\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.292417Z","iopub.execute_input":"2023-04-15T12:31:18.293165Z","iopub.status.idle":"2023-04-15T12:31:18.304818Z","shell.execute_reply.started":"2023-04-15T12:31:18.293112Z","shell.execute_reply":"2023-04-15T12:31:18.303439Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.dtypes\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.306817Z","iopub.execute_input":"2023-04-15T12:31:18.307598Z","iopub.status.idle":"2023-04-15T12:31:18.318374Z","shell.execute_reply.started":"2023-04-15T12:31:18.307566Z","shell.execute_reply":"2023-04-15T12:31:18.317378Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df2.dtypes\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.319955Z","iopub.execute_input":"2023-04-15T12:31:18.320649Z","iopub.status.idle":"2023-04-15T12:31:18.331560Z","shell.execute_reply.started":"2023-04-15T12:31:18.320615Z","shell.execute_reply":"2023-04-15T12:31:18.330422Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Is there missing data?","metadata":{}},{"cell_type":"code","source":"df.isnull().sum()\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.333151Z","iopub.execute_input":"2023-04-15T12:31:18.334384Z","iopub.status.idle":"2023-04-15T12:31:18.345883Z","shell.execute_reply.started":"2023-04-15T12:31:18.334326Z","shell.execute_reply":"2023-04-15T12:31:18.344674Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.isnull().sum()\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.347194Z","iopub.execute_input":"2023-04-15T12:31:18.347521Z","iopub.status.idle":"2023-04-15T12:31:18.384053Z","shell.execute_reply.started":"2023-04-15T12:31:18.347491Z","shell.execute_reply":"2023-04-15T12:31:18.382962Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df2.isnull().sum()\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.385875Z","iopub.execute_input":"2023-04-15T12:31:18.386301Z","iopub.status.idle":"2023-04-15T12:31:18.414200Z","shell.execute_reply.started":"2023-04-15T12:31:18.386261Z","shell.execute_reply":"2023-04-15T12:31:18.413016Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Information about the data","metadata":{}},{"cell_type":"code","source":"df.info()\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.416254Z","iopub.execute_input":"2023-04-15T12:31:18.417323Z","iopub.status.idle":"2023-04-15T12:31:18.439132Z","shell.execute_reply.started":"2023-04-15T12:31:18.417281Z","shell.execute_reply":"2023-04-15T12:31:18.437953Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.info()\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.440598Z","iopub.execute_input":"2023-04-15T12:31:18.441189Z","iopub.status.idle":"2023-04-15T12:31:18.479335Z","shell.execute_reply.started":"2023-04-15T12:31:18.441132Z","shell.execute_reply":"2023-04-15T12:31:18.478098Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df2.info()\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.480817Z","iopub.execute_input":"2023-04-15T12:31:18.484720Z","iopub.status.idle":"2023-04-15T12:31:18.515089Z","shell.execute_reply.started":"2023-04-15T12:31:18.484667Z","shell.execute_reply":"2023-04-15T12:31:18.513866Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Description of the data","metadata":{}},{"cell_type":"code","source":"df.describe()\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.516562Z","iopub.execute_input":"2023-04-15T12:31:18.517534Z","iopub.status.idle":"2023-04-15T12:31:18.534108Z","shell.execute_reply.started":"2023-04-15T12:31:18.517499Z","shell.execute_reply":"2023-04-15T12:31:18.533076Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.describe()\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.535351Z","iopub.execute_input":"2023-04-15T12:31:18.535705Z","iopub.status.idle":"2023-04-15T12:31:18.829141Z","shell.execute_reply.started":"2023-04-15T12:31:18.535674Z","shell.execute_reply":"2023-04-15T12:31:18.825874Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df2.describe()\n","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:18.831339Z","iopub.execute_input":"2023-04-15T12:31:18.832258Z","iopub.status.idle":"2023-04-15T12:31:19.065881Z","shell.execute_reply.started":"2023-04-15T12:31:18.832207Z","shell.execute_reply":"2023-04-15T12:31:19.064562Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.to_csv(\"submission.csv\",index=False)","metadata":{"execution":{"iopub.status.busy":"2023-04-15T12:31:19.067551Z","iopub.execute_input":"2023-04-15T12:31:19.067971Z","iopub.status.idle":"2023-04-15T12:31:19.077457Z","shell.execute_reply.started":"2023-04-15T12:31:19.067932Z","shell.execute_reply":"2023-04-15T12:31:19.076346Z"},"trusted":true},"execution_count":null,"outputs":[]}]}