forked from ourownstory/neuralprophet-data
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move kaggle dataset into new folder structure (ourownstory#9)
- Loading branch information
Showing
6 changed files
with
87 additions
and
391 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
87 changes: 87 additions & 0 deletions
87
kaggle-energy/preprocessing/kaggle-energy-preprocessing.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pandas as pd" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"df = pd.read_csv(\"../datasets_raw/energy/kaggle-energy-consumption-generation/energy_dataset.csv\")\n", | ||
"df.head()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Select only the columns we need\n", | ||
"df = df[[\"time\", \"price actual\"]]\n", | ||
"\n", | ||
"# Drop NaN values\n", | ||
"df = df[[\"time\", \"price actual\"]].dropna()\n", | ||
"\n", | ||
"# Rename columns ds and y\n", | ||
"df = df.rename(columns={\"time\": \"ds\", \"price actual\": \"y\"})\n", | ||
"\n", | ||
"# Convert to datetime\n", | ||
"df[\"ds\"] = pd.to_datetime(df[\"ds\"], utc=True).dt.tz_localize(None)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"df.head()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"df.to_csv(\"../datasets/kaggle-energy/tutorial01.csv\", index=False)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3.10.8 64-bit", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.8" | ||
}, | ||
"orig_nbformat": 4, | ||
"vscode": { | ||
"interpreter": { | ||
"hash": "949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1" | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.