{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.12.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[],"dockerImageVersionId":28755,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"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\n\n# Use the kagglehub client library to attach Kaggle resources like competitions, datasets, and models to your session\n# Learn more about kagglehub: https://github.com/Kaggle/kagglehub/blob/main/README.md\n\nimport kagglehub\n# kagglehub.dataset_download('<owner>/<dataset-slug>')\n\n\nimport numpy as np\nimport pandas as pd\n\nlabels = pd.read_csv('/kaggle/input/competitions/amex-default-prediction/train_labels.csv')\nprint(labels['target'].value_counts(normalize=True))","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2026-08-05T20:23:51.409590Z","iopub.execute_input":"2026-08-05T20:23:51.410033Z","iopub.status.idle":"2026-08-05T20:23:51.899936Z","shell.execute_reply.started":"2026-08-05T20:23:51.410003Z","shell.execute_reply":"2026-08-05T20:23:51.898972Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"chunk_iter = pd.read_csv(\n    '/kaggle/input/competitions/amex-default-prediction/train_data.csv',\n    chunksize=100000,\n    low_memory=False\n)\nfirst_chunk = next(chunk_iter)\nprint(\"first chunk:\", first_chunk.shape)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-08-05T20:23:51.901232Z","iopub.execute_input":"2026-08-05T20:23:51.901548Z","iopub.status.idle":"2026-08-05T20:23:56.527939Z","shell.execute_reply.started":"2026-08-05T20:23:51.901526Z","shell.execute_reply":"2026-08-05T20:23:56.526975Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print('First chunk shape:', first_chunk.shape)\nprint('Unique customers in chunk:', first_chunk['customer_ID'].nunique())\nprint('Date range:', first_chunk['S_2'].min(), 'to', first_chunk['S_2'].max())\n\nmissing = first_chunk.iloc[:, :10].isnull().mean().sort_values(ascending=False)\nprint('Missing ratio (top 10 cols):\\n', missing)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-08-05T20:23:56.528849Z","iopub.execute_input":"2026-08-05T20:23:56.529243Z","iopub.status.idle":"2026-08-05T20:23:56.579511Z","shell.execute_reply.started":"2026-08-05T20:23:56.529208Z","shell.execute_reply":"2026-08-05T20:23:56.578794Z"}},"outputs":[],"execution_count":null}]}