{"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 numpy as np\nimport pandas as pd\n\nTRAIN_PATH = \"../input/titanic/train.csv\"","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-07-24T12:11:13.355225Z","iopub.execute_input":"2022-07-24T12:11:13.355634Z","iopub.status.idle":"2022-07-24T12:11:13.361315Z","shell.execute_reply.started":"2022-07-24T12:11:13.355602Z","shell.execute_reply":"2022-07-24T12:11:13.359889Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv(TRAIN_PATH)\ntrain.head()","metadata":{"execution":{"iopub.status.busy":"2022-07-24T12:11:13.388193Z","iopub.execute_input":"2022-07-24T12:11:13.389277Z","iopub.status.idle":"2022-07-24T12:11:13.415344Z","shell.execute_reply.started":"2022-07-24T12:11:13.389238Z","shell.execute_reply":"2022-07-24T12:11:13.414211Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.info()","metadata":{"execution":{"iopub.status.busy":"2022-07-24T12:11:13.416955Z","iopub.execute_input":"2022-07-24T12:11:13.417405Z","iopub.status.idle":"2022-07-24T12:11:13.434623Z","shell.execute_reply.started":"2022-07-24T12:11:13.417373Z","shell.execute_reply":"2022-07-24T12:11:13.433437Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"col = \"Embarked\"","metadata":{"execution":{"iopub.status.busy":"2022-07-24T12:11:13.436479Z","iopub.execute_input":"2022-07-24T12:11:13.437015Z","iopub.status.idle":"2022-07-24T12:11:13.442219Z","shell.execute_reply.started":"2022-07-24T12:11:13.436968Z","shell.execute_reply":"2022-07-24T12:11:13.440907Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[col].unique()","metadata":{"execution":{"iopub.status.busy":"2022-07-24T12:11:13.453129Z","iopub.execute_input":"2022-07-24T12:11:13.453887Z","iopub.status.idle":"2022-07-24T12:11:13.461175Z","shell.execute_reply.started":"2022-07-24T12:11:13.453847Z","shell.execute_reply":"2022-07-24T12:11:13.460052Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"di = {\"S\":\"0\",\"C\":\"1\",\"Q\":\"2\",\"nan\":\"-1\"}\ntrain= train.replace({col:di})\ntrain.head()","metadata":{"execution":{"iopub.status.busy":"2022-07-24T12:11:13.616329Z","iopub.execute_input":"2022-07-24T12:11:13.617229Z","iopub.status.idle":"2022-07-24T12:11:13.636791Z","shell.execute_reply.started":"2022-07-24T12:11:13.617186Z","shell.execute_reply":"2022-07-24T12:11:13.635955Z"},"trusted":true},"execution_count":null,"outputs":[]}]}