{"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":50160,"databundleVersionId":7602123,"sourceType":"competition"},{"sourceId":7591967,"sourceType":"datasetVersion","datasetId":4419280}],"dockerImageVersionId":30646,"isInternetEnabled":true,"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)\npd.options.display.max_columns=None\npd.options.display.max_rows=None\n\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\nimport gc\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-02-12T04:27:14.097997Z","iopub.execute_input":"2024-02-12T04:27:14.098390Z","iopub.status.idle":"2024-02-12T04:27:14.104427Z","shell.execute_reply.started":"2024-02-12T04:27:14.098363Z","shell.execute_reply":"2024-02-12T04:27:14.103232Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### とりあえず特徴量が多すぎなので理解のためにfeature_definitionsに日本語訳かけた. （Powered by ChatGPT）\n#### 2024-02-12: 各trainデータのカラムを翻訳したものを追加.","metadata":{}},{"cell_type":"code","source":"df = pd.read_csv(\"/kaggle/input/translated-feature-definitions-home-credit/feature_definitions_translated.csv\")","metadata":{"execution":{"iopub.status.busy":"2024-02-12T04:24:53.951579Z","iopub.execute_input":"2024-02-12T04:24:53.952114Z","iopub.status.idle":"2024-02-12T04:24:53.988792Z","shell.execute_reply.started":"2024-02-12T04:24:53.952082Z","shell.execute_reply":"2024-02-12T04:24:53.987190Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### trainデータそれぞれの特徴量を日本語で出力","metadata":{}},{"cell_type":"code","source":"rename_dict = {}\nfor index, row in df.iterrows():\n    rename_dict[row[\"Variable\"]] = row[\"translated_definition\"]","metadata":{"execution":{"iopub.status.busy":"2024-02-12T04:24:55.089773Z","iopub.execute_input":"2024-02-12T04:24:55.090523Z","iopub.status.idle":"2024-02-12T04:24:55.125157Z","shell.execute_reply.started":"2024-02-12T04:24:55.090483Z","shell.execute_reply":"2024-02-12T04:24:55.124064Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        if '.csv' in filename and 'train_' in filename:\n            print(\"----------------------------------------\")\n            print(filename)\n            translate_obj = pd.read_csv(os.path.join(dirname, filename), low_memory=False, nrows=5)\n            translate_obj.rename(columns=rename_dict, inplace=True)\n            display(translate_obj)\n            gc.collect()\n            del translate_obj","metadata":{"execution":{"iopub.status.busy":"2024-02-12T04:27:16.643284Z","iopub.execute_input":"2024-02-12T04:27:16.643672Z","iopub.status.idle":"2024-02-12T04:40:50.167825Z","shell.execute_reply.started":"2024-02-12T04:27:16.643644Z","shell.execute_reply":"2024-02-12T04:40:50.164809Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# ","metadata":{}}]}