{"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 seaborn as sns \nimport matplotlib as plt\nfrom matplotlib import pyplot as plt","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:26.930924Z","iopub.execute_input":"2022-07-04T23:34:26.931402Z","iopub.status.idle":"2022-07-04T23:34:26.938459Z","shell.execute_reply.started":"2022-07-04T23:34:26.931365Z","shell.execute_reply":"2022-07-04T23:34:26.936876Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train= pd.read_csv('../input/spaceship-titanic/train.csv')\ntest= pd.read_csv('../input/spaceship-titanic/test.csv')","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:26.971512Z","iopub.execute_input":"2022-07-04T23:34:26.971926Z","iopub.status.idle":"2022-07-04T23:34:27.026451Z","shell.execute_reply.started":"2022-07-04T23:34:26.971894Z","shell.execute_reply":"2022-07-04T23:34:27.025347Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.029076Z","iopub.execute_input":"2022-07-04T23:34:27.029667Z","iopub.status.idle":"2022-07-04T23:34:27.04433Z","shell.execute_reply.started":"2022-07-04T23:34:27.029619Z","shell.execute_reply":"2022-07-04T23:34:27.042907Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = train.append(test, ignore_index=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.045928Z","iopub.execute_input":"2022-07-04T23:34:27.046479Z","iopub.status.idle":"2022-07-04T23:34:27.061161Z","shell.execute_reply.started":"2022-07-04T23:34:27.046433Z","shell.execute_reply":"2022-07-04T23:34:27.059985Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.drop('Name', axis='columns', inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.062946Z","iopub.execute_input":"2022-07-04T23:34:27.063422Z","iopub.status.idle":"2022-07-04T23:34:27.075538Z","shell.execute_reply.started":"2022-07-04T23:34:27.063374Z","shell.execute_reply":"2022-07-04T23:34:27.074255Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['Age'].fillna(\"28\", inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.167661Z","iopub.execute_input":"2022-07-04T23:34:27.168746Z","iopub.status.idle":"2022-07-04T23:34:27.177102Z","shell.execute_reply.started":"2022-07-04T23:34:27.168703Z","shell.execute_reply":"2022-07-04T23:34:27.175611Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['Cabin'].str.split('/', expand=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.268268Z","iopub.execute_input":"2022-07-04T23:34:27.268686Z","iopub.status.idle":"2022-07-04T23:34:27.310481Z","shell.execute_reply.started":"2022-07-04T23:34:27.268653Z","shell.execute_reply":"2022-07-04T23:34:27.309007Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[['deck', 'num', 'side']] = df['Cabin'].str.split('/', expand=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.342304Z","iopub.execute_input":"2022-07-04T23:34:27.342828Z","iopub.status.idle":"2022-07-04T23:34:27.379428Z","shell.execute_reply.started":"2022-07-04T23:34:27.342789Z","shell.execute_reply":"2022-07-04T23:34:27.378404Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['side'].fillna(\"S\", inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.381432Z","iopub.execute_input":"2022-07-04T23:34:27.382115Z","iopub.status.idle":"2022-07-04T23:34:27.389777Z","shell.execute_reply.started":"2022-07-04T23:34:27.382082Z","shell.execute_reply":"2022-07-04T23:34:27.38851Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.preprocessing import LabelEncoder\nlabelencoder = LabelEncoder()","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.400276Z","iopub.execute_input":"2022-07-04T23:34:27.401179Z","iopub.status.idle":"2022-07-04T23:34:27.406488Z","shell.execute_reply.started":"2022-07-04T23:34:27.401143Z","shell.execute_reply":"2022-07-04T23:34:27.405204Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['side'] = labelencoder.fit_transform(df['side'])\ndf","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.453261Z","iopub.execute_input":"2022-07-04T23:34:27.453998Z","iopub.status.idle":"2022-07-04T23:34:27.495212Z","shell.execute_reply.started":"2022-07-04T23:34:27.453965Z","shell.execute_reply":"2022-07-04T23:34:27.4934Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.drop('num', axis='columns', inplace=True)\ndf.drop('deck', axis='columns', inplace=True)\ndf.drop('Destination', axis='columns', inplace=True)\ndf.drop('Cabin', axis='columns', inplace=True)\ndf.drop('RoomService', axis='columns', inplace=True)\ndf.drop('VRDeck', axis='columns', inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.49962Z","iopub.execute_input":"2022-07-04T23:34:27.499986Z","iopub.status.idle":"2022-07-04T23:34:27.523588Z","shell.execute_reply.started":"2022-07-04T23:34:27.499953Z","shell.execute_reply":"2022-07-04T23:34:27.522466Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['HomePlanet'] = labelencoder.fit_transform(df['HomePlanet'])\n","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.524929Z","iopub.execute_input":"2022-07-04T23:34:27.525249Z","iopub.status.idle":"2022-07-04T23:34:27.536884Z","shell.execute_reply.started":"2022-07-04T23:34:27.525187Z","shell.execute_reply":"2022-07-04T23:34:27.535596Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['VIP'] = labelencoder.fit_transform(df['VIP'])\ndf['CryoSleep'] = labelencoder.fit_transform(df['CryoSleep'])","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.540997Z","iopub.execute_input":"2022-07-04T23:34:27.541367Z","iopub.status.idle":"2022-07-04T23:34:27.557587Z","shell.execute_reply.started":"2022-07-04T23:34:27.541335Z","shell.execute_reply":"2022-07-04T23:34:27.556423Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[\"Age\"] = df[\"Age\"].astype(object).astype(int)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.562709Z","iopub.execute_input":"2022-07-04T23:34:27.563098Z","iopub.status.idle":"2022-07-04T23:34:27.571508Z","shell.execute_reply.started":"2022-07-04T23:34:27.563064Z","shell.execute_reply":"2022-07-04T23:34:27.570267Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[\"ShoppingMall\"].fillna(value=df['ShoppingMall'].mean(), inplace=True)\ndf[\"Spa\"].fillna(value= df['Spa'].mean(), inplace=True)\ndf[\"FoodCourt\"].fillna(value=df['ShoppingMall'].mean(), inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.589683Z","iopub.execute_input":"2022-07-04T23:34:27.590956Z","iopub.status.idle":"2022-07-04T23:34:27.599597Z","shell.execute_reply.started":"2022-07-04T23:34:27.590917Z","shell.execute_reply":"2022-07-04T23:34:27.598597Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.619119Z","iopub.execute_input":"2022-07-04T23:34:27.619734Z","iopub.status.idle":"2022-07-04T23:34:27.632375Z","shell.execute_reply.started":"2022-07-04T23:34:27.619701Z","shell.execute_reply":"2022-07-04T23:34:27.631436Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.info()","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.649532Z","iopub.execute_input":"2022-07-04T23:34:27.650115Z","iopub.status.idle":"2022-07-04T23:34:27.667751Z","shell.execute_reply.started":"2022-07-04T23:34:27.650083Z","shell.execute_reply":"2022-07-04T23:34:27.666369Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X= df.drop(labels = 'Transported',axis = 1).values\ny= df.Transported","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.703722Z","iopub.execute_input":"2022-07-04T23:34:27.704155Z","iopub.status.idle":"2022-07-04T23:34:27.718886Z","shell.execute_reply.started":"2022-07-04T23:34:27.704122Z","shell.execute_reply":"2022-07-04T23:34:27.717348Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = df.set_index('PassengerId')","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.745866Z","iopub.execute_input":"2022-07-04T23:34:27.746605Z","iopub.status.idle":"2022-07-04T23:34:27.75528Z","shell.execute_reply.started":"2022-07-04T23:34:27.746565Z","shell.execute_reply":"2022-07-04T23:34:27.754245Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.775015Z","iopub.execute_input":"2022-07-04T23:34:27.775458Z","iopub.status.idle":"2022-07-04T23:34:27.806294Z","shell.execute_reply.started":"2022-07-04T23:34:27.775425Z","shell.execute_reply":"2022-07-04T23:34:27.803868Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df = df[df.Transported.isna() == False]\ntest_df= df[df.Transported.isna()]","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:27.848384Z","iopub.execute_input":"2022-07-04T23:34:27.849297Z","iopub.status.idle":"2022-07-04T23:34:27.861072Z","shell.execute_reply.started":"2022-07-04T23:34:27.849244Z","shell.execute_reply":"2022-07-04T23:34:27.859803Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:28.009761Z","iopub.execute_input":"2022-07-04T23:34:28.010674Z","iopub.status.idle":"2022-07-04T23:34:28.035528Z","shell.execute_reply.started":"2022-07-04T23:34:28.010631Z","shell.execute_reply":"2022-07-04T23:34:28.033985Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:28.123939Z","iopub.execute_input":"2022-07-04T23:34:28.124374Z","iopub.status.idle":"2022-07-04T23:34:28.1503Z","shell.execute_reply.started":"2022-07-04T23:34:28.124341Z","shell.execute_reply":"2022-07-04T23:34:28.149094Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Model","metadata":{}},{"cell_type":"code","source":"train_df['Transported']= labelencoder.fit_transform(train_df['Transported'])","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:28.220554Z","iopub.execute_input":"2022-07-04T23:34:28.220944Z","iopub.status.idle":"2022-07-04T23:34:28.232236Z","shell.execute_reply.started":"2022-07-04T23:34:28.220912Z","shell.execute_reply":"2022-07-04T23:34:28.230789Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:28.335241Z","iopub.execute_input":"2022-07-04T23:34:28.335649Z","iopub.status.idle":"2022-07-04T23:34:28.357118Z","shell.execute_reply.started":"2022-07-04T23:34:28.335611Z","shell.execute_reply":"2022-07-04T23:34:28.356102Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:28.433166Z","iopub.execute_input":"2022-07-04T23:34:28.433592Z","iopub.status.idle":"2022-07-04T23:34:28.448226Z","shell.execute_reply.started":"2022-07-04T23:34:28.433559Z","shell.execute_reply":"2022-07-04T23:34:28.446438Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:28.542579Z","iopub.execute_input":"2022-07-04T23:34:28.543603Z","iopub.status.idle":"2022-07-04T23:34:28.55646Z","shell.execute_reply.started":"2022-07-04T23:34:28.543555Z","shell.execute_reply":"2022-07-04T23:34:28.554627Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.linear_model import LogisticRegression\nfrom sklearn.metrics import confusion_matrix, classification_report\nfrom sklearn.model_selection import train_test_split","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:28.674035Z","iopub.execute_input":"2022-07-04T23:34:28.674955Z","iopub.status.idle":"2022-07-04T23:34:28.680946Z","shell.execute_reply.started":"2022-07-04T23:34:28.674901Z","shell.execute_reply":"2022-07-04T23:34:28.679862Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"a= train_df.drop(labels = 'Transported',axis = 1).values\nb= train_df.Transported","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:28.799359Z","iopub.execute_input":"2022-07-04T23:34:28.800016Z","iopub.status.idle":"2022-07-04T23:34:28.80878Z","shell.execute_reply.started":"2022-07-04T23:34:28.799981Z","shell.execute_reply":"2022-07-04T23:34:28.807428Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.shape","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:28.88628Z","iopub.execute_input":"2022-07-04T23:34:28.887043Z","iopub.status.idle":"2022-07-04T23:34:28.894408Z","shell.execute_reply.started":"2022-07-04T23:34:28.887008Z","shell.execute_reply":"2022-07-04T23:34:28.893316Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.info()","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:28.957891Z","iopub.execute_input":"2022-07-04T23:34:28.958556Z","iopub.status.idle":"2022-07-04T23:34:28.974718Z","shell.execute_reply.started":"2022-07-04T23:34:28.958524Z","shell.execute_reply":"2022-07-04T23:34:28.972711Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"a_train, a_test, b_train, b_test = train_test_split(a, b, test_size = 0.4, random_state=42)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.070252Z","iopub.execute_input":"2022-07-04T23:34:29.070704Z","iopub.status.idle":"2022-07-04T23:34:29.084373Z","shell.execute_reply.started":"2022-07-04T23:34:29.070664Z","shell.execute_reply":"2022-07-04T23:34:29.082486Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model = LogisticRegression()","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.159528Z","iopub.execute_input":"2022-07-04T23:34:29.16076Z","iopub.status.idle":"2022-07-04T23:34:29.166604Z","shell.execute_reply.started":"2022-07-04T23:34:29.160722Z","shell.execute_reply":"2022-07-04T23:34:29.164803Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model.fit(a_train, b_train)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.306565Z","iopub.execute_input":"2022-07-04T23:34:29.307033Z","iopub.status.idle":"2022-07-04T23:34:29.432429Z","shell.execute_reply.started":"2022-07-04T23:34:29.307Z","shell.execute_reply":"2022-07-04T23:34:29.430968Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred = model.predict(a_test)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.435267Z","iopub.execute_input":"2022-07-04T23:34:29.436104Z","iopub.status.idle":"2022-07-04T23:34:29.447102Z","shell.execute_reply.started":"2022-07-04T23:34:29.436054Z","shell.execute_reply":"2022-07-04T23:34:29.444642Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.449631Z","iopub.execute_input":"2022-07-04T23:34:29.450523Z","iopub.status.idle":"2022-07-04T23:34:29.460917Z","shell.execute_reply.started":"2022-07-04T23:34:29.450474Z","shell.execute_reply":"2022-07-04T23:34:29.458708Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(confusion_matrix(b_test, y_pred))\nprint(classification_report(b_test, y_pred))","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.528188Z","iopub.execute_input":"2022-07-04T23:34:29.528879Z","iopub.status.idle":"2022-07-04T23:34:29.561607Z","shell.execute_reply.started":"2022-07-04T23:34:29.528823Z","shell.execute_reply":"2022-07-04T23:34:29.559738Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"test","metadata":{}},{"cell_type":"code","source":"test_df.drop(\"Transported\", axis='columns', inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.588676Z","iopub.execute_input":"2022-07-04T23:34:29.589722Z","iopub.status.idle":"2022-07-04T23:34:29.599614Z","shell.execute_reply.started":"2022-07-04T23:34:29.589633Z","shell.execute_reply":"2022-07-04T23:34:29.598189Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.726376Z","iopub.execute_input":"2022-07-04T23:34:29.727073Z","iopub.status.idle":"2022-07-04T23:34:29.752908Z","shell.execute_reply.started":"2022-07-04T23:34:29.727032Z","shell.execute_reply":"2022-07-04T23:34:29.751588Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred_test =model.predict(test_df)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.754727Z","iopub.execute_input":"2022-07-04T23:34:29.755309Z","iopub.status.idle":"2022-07-04T23:34:29.768871Z","shell.execute_reply.started":"2022-07-04T23:34:29.755277Z","shell.execute_reply":"2022-07-04T23:34:29.767434Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred_test","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.772189Z","iopub.execute_input":"2022-07-04T23:34:29.772907Z","iopub.status.idle":"2022-07-04T23:34:29.783556Z","shell.execute_reply.started":"2022-07-04T23:34:29.772851Z","shell.execute_reply":"2022-07-04T23:34:29.780818Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"k = []\nfor i in range(len(y_pred_test)) :\n    if  y_pred_test[i] == 1:\n        k.append('True')\n    else :\n        k.append('False')\n    ","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.787043Z","iopub.execute_input":"2022-07-04T23:34:29.787782Z","iopub.status.idle":"2022-07-04T23:34:29.811616Z","shell.execute_reply.started":"2022-07-04T23:34:29.787725Z","shell.execute_reply":"2022-07-04T23:34:29.80948Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"k","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.818738Z","iopub.execute_input":"2022-07-04T23:34:29.824442Z","iopub.status.idle":"2022-07-04T23:34:29.874765Z","shell.execute_reply.started":"2022-07-04T23:34:29.824368Z","shell.execute_reply":"2022-07-04T23:34:29.873097Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"c=np.array(k)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.878404Z","iopub.execute_input":"2022-07-04T23:34:29.879183Z","iopub.status.idle":"2022-07-04T23:34:29.888054Z","shell.execute_reply.started":"2022-07-04T23:34:29.879134Z","shell.execute_reply":"2022-07-04T23:34:29.886634Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"c","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.889913Z","iopub.execute_input":"2022-07-04T23:34:29.891007Z","iopub.status.idle":"2022-07-04T23:34:29.901326Z","shell.execute_reply.started":"2022-07-04T23:34:29.890971Z","shell.execute_reply":"2022-07-04T23:34:29.89995Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.903474Z","iopub.execute_input":"2022-07-04T23:34:29.904576Z","iopub.status.idle":"2022-07-04T23:34:29.929612Z","shell.execute_reply.started":"2022-07-04T23:34:29.904536Z","shell.execute_reply":"2022-07-04T23:34:29.928184Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df.reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.931226Z","iopub.execute_input":"2022-07-04T23:34:29.93157Z","iopub.status.idle":"2022-07-04T23:34:29.956377Z","shell.execute_reply.started":"2022-07-04T23:34:29.931539Z","shell.execute_reply":"2022-07-04T23:34:29.955225Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df.reset_index(drop=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.957838Z","iopub.execute_input":"2022-07-04T23:34:29.958279Z","iopub.status.idle":"2022-07-04T23:34:29.984084Z","shell.execute_reply.started":"2022-07-04T23:34:29.958246Z","shell.execute_reply":"2022-07-04T23:34:29.982733Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:34:29.987217Z","iopub.execute_input":"2022-07-04T23:34:29.989398Z","iopub.status.idle":"2022-07-04T23:34:30.011294Z","shell.execute_reply.started":"2022-07-04T23:34:29.989359Z","shell.execute_reply":"2022-07-04T23:34:30.009727Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:35:01.420907Z","iopub.execute_input":"2022-07-04T23:35:01.421344Z","iopub.status.idle":"2022-07-04T23:35:01.446141Z","shell.execute_reply.started":"2022-07-04T23:35:01.421309Z","shell.execute_reply":"2022-07-04T23:35:01.444607Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df['Transported'] = c\ntest_df.index.name = 'PassengerId'\nsub = test_df[['Transported']].reset_index()\nsub.to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:35:02.264978Z","iopub.execute_input":"2022-07-04T23:35:02.266123Z","iopub.status.idle":"2022-07-04T23:35:02.285119Z","shell.execute_reply.started":"2022-07-04T23:35:02.266076Z","shell.execute_reply":"2022-07-04T23:35:02.284141Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:35:03.954386Z","iopub.execute_input":"2022-07-04T23:35:03.955152Z","iopub.status.idle":"2022-07-04T23:35:03.978278Z","shell.execute_reply.started":"2022-07-04T23:35:03.955088Z","shell.execute_reply":"2022-07-04T23:35:03.976227Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub.to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2022-07-04T23:35:05.202858Z","iopub.execute_input":"2022-07-04T23:35:05.204076Z","iopub.status.idle":"2022-07-04T23:35:05.221565Z","shell.execute_reply.started":"2022-07-04T23:35:05.204024Z","shell.execute_reply":"2022-07-04T23:35:05.220298Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}