{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":56537,"databundleVersionId":8015876,"sourceType":"competition"}],"dockerImageVersionId":30698,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np\nimport pandas as pd \nimport csv","metadata":{"execution":{"iopub.status.busy":"2024-04-22T07:43:51.146683Z","iopub.execute_input":"2024-04-22T07:43:51.147295Z","iopub.status.idle":"2024-04-22T07:43:52.429207Z","shell.execute_reply.started":"2024-04-22T07:43:51.147242Z","shell.execute_reply":"2024-04-22T07:43:52.428221Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import 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":"2024-04-22T07:43:52.431731Z","iopub.execute_input":"2024-04-22T07:43:52.432717Z","iopub.status.idle":"2024-04-22T07:43:52.441026Z","shell.execute_reply.started":"2024-04-22T07:43:52.432672Z","shell.execute_reply":"2024-04-22T07:43:52.439906Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_path='/kaggle/input/leap-atmospheric-physics-ai-climsim/test.csv'","metadata":{"execution":{"iopub.status.busy":"2024-04-22T05:49:54.099071Z","iopub.execute_input":"2024-04-22T05:49:54.09962Z","iopub.status.idle":"2024-04-22T05:49:54.105122Z","shell.execute_reply.started":"2024-04-22T05:49:54.09958Z","shell.execute_reply":"2024-04-22T05:49:54.10365Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train=pd.read_csv('/kaggle/input/leap-atmospheric-physics-ai-climsim/train.csv',nrows=1000000)","metadata":{"execution":{"iopub.status.busy":"2024-04-22T07:48:53.336475Z","iopub.execute_input":"2024-04-22T07:48:53.336898Z","iopub.status.idle":"2024-04-22T07:56:34.801092Z","shell.execute_reply.started":"2024-04-22T07:48:53.336863Z","shell.execute_reply":"2024-04-22T07:56:34.799503Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.head()","metadata":{"execution":{"iopub.status.busy":"2024-04-22T08:10:02.844492Z","iopub.execute_input":"2024-04-22T08:10:02.845071Z","iopub.status.idle":"2024-04-22T08:10:02.911756Z","shell.execute_reply.started":"2024-04-22T08:10:02.844981Z","shell.execute_reply":"2024-04-22T08:10:02.910553Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = train.apply(pd.to_numeric, errors='coerce')\n\nsingle_unique_cols = []\nfor col in df.columns:\n    unique_values = df[col].dropna().unique()\n    if len(unique_values) == 1:\n        single_unique_cols.append(col)\n\nprint(\"Columns with only one unique value:\")\nprint(single_unique_cols)","metadata":{"execution":{"iopub.status.busy":"2024-04-22T08:11:14.969414Z","iopub.execute_input":"2024-04-22T08:11:14.969794Z","iopub.status.idle":"2024-04-22T08:12:12.900562Z","shell.execute_reply.started":"2024-04-22T08:11:14.969766Z","shell.execute_reply":"2024-04-22T08:12:12.899196Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test=pd.read_csv('/kaggle/input/leap-atmospheric-physics-ai-climsim/test.csv',nrows=10000)","metadata":{"execution":{"iopub.status.busy":"2024-04-22T08:15:43.904413Z","iopub.execute_input":"2024-04-22T08:15:43.904839Z","iopub.status.idle":"2024-04-22T08:15:45.592674Z","shell.execute_reply.started":"2024-04-22T08:15:43.904803Z","shell.execute_reply":"2024-04-22T08:15:45.591598Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_test = test.apply(pd.to_numeric, errors='coerce')\n\nsingle_unique_cols_test = []\nfor col in df_test.columns:\n    unique_values_test = df_test[col].dropna().unique()\n    if len(unique_values_test) == 1:\n        single_unique_cols_test.append(col)\n\nprint(\"Columns with only one unique value:\")\nprint(single_unique_cols_test)","metadata":{"execution":{"iopub.status.busy":"2024-04-22T08:16:22.39275Z","iopub.execute_input":"2024-04-22T08:16:22.393149Z","iopub.status.idle":"2024-04-22T08:16:22.844237Z","shell.execute_reply.started":"2024-04-22T08:16:22.393117Z","shell.execute_reply":"2024-04-22T08:16:22.843054Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Using set intersection to find which covariates have same values in train and test  \ncommon_elements = set(single_unique_cols).intersection(single_unique_cols_test)\nprint(\"Common elements:\", common_elements)","metadata":{"execution":{"iopub.status.busy":"2024-04-22T08:16:32.522381Z","iopub.execute_input":"2024-04-22T08:16:32.522768Z","iopub.status.idle":"2024-04-22T08:16:32.530091Z","shell.execute_reply.started":"2024-04-22T08:16:32.522729Z","shell.execute_reply":"2024-04-22T08:16:32.528724Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"common_elements","metadata":{"execution":{"iopub.status.busy":"2024-04-22T08:18:28.414185Z","iopub.execute_input":"2024-04-22T08:18:28.414576Z","iopub.status.idle":"2024-04-22T08:18:28.422191Z","shell.execute_reply.started":"2024-04-22T08:18:28.414547Z","shell.execute_reply":"2024-04-22T08:18:28.42133Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"common_elements_with_same_values = []\n\nfor column in common_elements:\n    if df[column].dropna().unique().tolist() == df_test[column].dropna().unique().tolist():\n        common_elements_with_same_values.append(column)\n\nprint(\"Common elements with the same values in both dataframes:\", common_elements_with_same_values)\n","metadata":{"execution":{"iopub.status.busy":"2024-04-22T08:20:05.203015Z","iopub.execute_input":"2024-04-22T08:20:05.203743Z","iopub.status.idle":"2024-04-22T08:20:06.519202Z","shell.execute_reply.started":"2024-04-22T08:20:05.203689Z","shell.execute_reply":"2024-04-22T08:20:06.518013Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(common_elements_with_same_values)","metadata":{"execution":{"iopub.status.busy":"2024-04-22T08:21:07.641375Z","iopub.execute_input":"2024-04-22T08:21:07.641803Z","iopub.status.idle":"2024-04-22T08:21:07.649463Z","shell.execute_reply.started":"2024-04-22T08:21:07.641769Z","shell.execute_reply":"2024-04-22T08:21:07.648303Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#so to conclude this are ","metadata":{},"execution_count":null,"outputs":[]}]}