{"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":"markdown","source":"Bulan Cahya Sofa - 2206810622\nJessy Yunardi - 2206053985\nNadhif Maulandra Aftaura - 2206028011","metadata":{}},{"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)\nimport seaborn as sns\nimport matplotlib.pyplot as plt\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","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-05-11T13:45:12.488065Z","iopub.execute_input":"2023-05-11T13:45:12.488446Z","iopub.status.idle":"2023-05-11T13:45:13.191452Z","shell.execute_reply.started":"2023-05-11T13:45:12.488419Z","shell.execute_reply":"2023-05-11T13:45:13.189406Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Read data yang ingin digunakan\ndata=pd.read_csv(r'/kaggle/input/ashrae-energy-prediction/train.csv')\ndata","metadata":{"execution":{"iopub.status.busy":"2023-05-11T13:45:13.193234Z","iopub.execute_input":"2023-05-11T13:45:13.193548Z","iopub.status.idle":"2023-05-11T13:45:33.580663Z","shell.execute_reply.started":"2023-05-11T13:45:13.193522Z","shell.execute_reply":"2023-05-11T13:45:33.579580Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Cek data type\ndata.info()","metadata":{"execution":{"iopub.status.busy":"2023-05-11T13:45:33.581811Z","iopub.execute_input":"2023-05-11T13:45:33.582101Z","iopub.status.idle":"2023-05-11T13:45:33.605194Z","shell.execute_reply.started":"2023-05-11T13:45:33.582076Z","shell.execute_reply":"2023-05-11T13:45:33.603963Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Ubah data type timestamp dari object menjadi index untuk membagi data perbulan\ntimedata=pd.read_csv(r'/kaggle/input/ashrae-energy-prediction/train.csv',parse_dates=True, index_col = \"timestamp\")\ntimedata","metadata":{"execution":{"iopub.status.busy":"2023-05-11T13:45:33.608049Z","iopub.execute_input":"2023-05-11T13:45:33.608801Z","iopub.status.idle":"2023-05-11T13:45:48.800586Z","shell.execute_reply.started":"2023-05-11T13:45:33.608761Z","shell.execute_reply":"2023-05-11T13:45:48.799429Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Cek missing value\ntimedata.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2023-05-11T13:45:48.801829Z","iopub.execute_input":"2023-05-11T13:45:48.802136Z","iopub.status.idle":"2023-05-11T13:45:48.877474Z","shell.execute_reply.started":"2023-05-11T13:45:48.802110Z","shell.execute_reply":"2023-05-11T13:45:48.876672Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Buat data untuk rata-rata perbulan\ndf_month = timedata.resample(\"M\").mean()\ndf_month","metadata":{"execution":{"iopub.status.busy":"2023-05-11T13:45:48.878759Z","iopub.execute_input":"2023-05-11T13:45:48.879298Z","iopub.status.idle":"2023-05-11T13:45:49.992248Z","shell.execute_reply.started":"2023-05-11T13:45:48.879269Z","shell.execute_reply":"2023-05-11T13:45:49.991200Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Plot penggunaan listrik perbulan\nreading_plot = df_month['meter_reading'].plot(figsize=(8, 5),marker='o')\nreading_plot.set_xlabel('Month')\nreading_plot.set_ylabel('kWh consumption')\nplt.title('kWh Consumption per-month in 2016')","metadata":{"execution":{"iopub.status.busy":"2023-05-11T13:45:49.993769Z","iopub.execute_input":"2023-05-11T13:45:49.994166Z","iopub.status.idle":"2023-05-11T13:45:50.392850Z","shell.execute_reply.started":"2023-05-11T13:45:49.994131Z","shell.execute_reply":"2023-05-11T13:45:50.391914Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Dari data yang kami dapatkan, bisa dilihat bahwa rata-rata penggunakan energi terbanyak di tahun 2016 berada pada bulan Mei di kisaran 5566 kWh dan rata-rata penggunaan terkecil pada bulan Juli di kisaran 459 kWh. Hal ini membuktikan bahwa konsumsi energi bangunan baru cenderung lebih rendah dibanding dengan bangunan asli.","metadata":{}}]}