{"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 # untuk mengimport data\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-04-06T10:13:33.588547Z","iopub.execute_input":"2022-04-06T10:13:33.589244Z","iopub.status.idle":"2022-04-06T10:13:33.613336Z","shell.execute_reply.started":"2022-04-06T10:13:33.589173Z","shell.execute_reply":"2022-04-06T10:13:33.612847Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Import Data**","metadata":{}},{"cell_type":"code","source":"# Data Gedung \"gd\"\ngd = pd.read_csv('../input/ashrae-energy-prediction/building_metadata.csv')\ngd.info() #melihat informasi data","metadata":{"execution":{"iopub.status.busy":"2022-04-06T10:14:21.896881Z","iopub.execute_input":"2022-04-06T10:14:21.897129Z","iopub.status.idle":"2022-04-06T10:14:21.940763Z","shell.execute_reply.started":"2022-04-06T10:14:21.897094Z","shell.execute_reply":"2022-04-06T10:14:21.939702Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Data Energy Gedung variabel train \"en_train\"\nen_train = pd.read_csv('../input/ashrae-energy-prediction/train.csv')\nen_train.info()","metadata":{"execution":{"iopub.status.busy":"2022-04-06T10:14:24.256385Z","iopub.execute_input":"2022-04-06T10:14:24.256643Z","iopub.status.idle":"2022-04-06T10:14:39.429528Z","shell.execute_reply.started":"2022-04-06T10:14:24.256607Z","shell.execute_reply":"2022-04-06T10:14:39.429039Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Data Cuaca variabel train \"cu_train\"\ncu_train = pd.read_csv('../input/ashrae-energy-prediction/weather_train.csv')\ncu_train.info()","metadata":{"execution":{"iopub.status.busy":"2022-04-06T10:14:50.850546Z","iopub.execute_input":"2022-04-06T10:14:50.851091Z","iopub.status.idle":"2022-04-06T10:14:51.083879Z","shell.execute_reply.started":"2022-04-06T10:14:50.851054Z","shell.execute_reply":"2022-04-06T10:14:51.083173Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Data Energy Gedung variabel test \"en_test\"\nen_test = pd.read_csv('../input/ashrae-energy-prediction/test.csv')\nen_test.info()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Data Cuaca variabel test \"cu_test\"\ncu_test = pd.read_csv('../input/ashrae-energy-prediction/weather_test.csv')\ncu_test.info()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Akan digabung data dari variabel train (data gedung, energy gedung, dan data cuaca gedung) dengan menyocokkan building_id pada data gedung dan energy gedung, dan site_id serta timestamp pada data gedung dan cuaca. Lakukan hal yang sama pada variabel test","metadata":{}},{"cell_type":"code","source":"# Tabel Train (Gabungan Dataset Gedung, Energy Gedung, dan Data Cuaca Gedung pada variabel train)\ntrain = gd.merge(en_train, on ='building_id', how = 'left').merge(cu_train, on = ('site_id', 'timestamp'), how = 'left')\ntrain.head()","metadata":{"execution":{"iopub.status.busy":"2022-04-06T10:14:57.970132Z","iopub.execute_input":"2022-04-06T10:14:57.971039Z","iopub.status.idle":"2022-04-06T10:15:07.169687Z","shell.execute_reply.started":"2022-04-06T10:14:57.971005Z","shell.execute_reply":"2022-04-06T10:15:07.168896Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Tabel Test (Gabungan Dataset Gedung, Energy Gedung, dan Data Cuaca Gedung pada varaiebl test)\ntest = gd.merge(en_test, on ='building_id', how = 'left').merge(cu_test, on =('site_id','timestamp'), how ='left')\ntest.head()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.to_csv('mycsvfile.csv',index=False) # mendownload dataset train(yang telah dimerge)\n#link kaggle : https://www.kaggle.com/code/faviansulthanwafi/tugas-eda-kelompok-b?scriptVersionId=92183473","metadata":{"execution":{"iopub.status.busy":"2022-04-04T14:05:07.710324Z","iopub.execute_input":"2022-04-04T14:05:07.711206Z","iopub.status.idle":"2022-04-04T14:08:54.387556Z","shell.execute_reply.started":"2022-04-04T14:05:07.711157Z","shell.execute_reply":"2022-04-04T14:08:54.386507Z"},"trusted":true},"execution_count":null,"outputs":[]}]}