-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 733de7d
Showing
2 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
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,3 @@ | ||
*.zip | ||
.ipynb_checkpoints | ||
|
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,114 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# AirBnB Dataset\n", | ||
"\n", | ||
"Below are a few things to get you started with the AirBnB dataset for AIHack! For more information on the table schemata, see [here](https://docs.google.com/document/d/1ezVFDe506zK1CuuNhNmzHEj_iNnL67hDrFzSap9V7S0/edit?usp=sharing)." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Download data - please only run this once\n", | ||
"import urllib.request\n", | ||
"import zipfile\n", | ||
"import os\n", | ||
"\n", | ||
"print(\"Starting download ...\")\n", | ||
"#with urllib.request.urlopen(\"https://tilman.xyz\") as src:\n", | ||
"# with open(\"tmp_airbnb_data.zip\", \"wb\") as dest:\n", | ||
"# dest.write(src.read())\n", | ||
"print(\"Unpacking archive ...\")\n", | ||
"os.makedirs(\"airbnb_data\", exist_ok=True)\n", | ||
"with zipfile.ZipFile(\"tmp_airbnb_data.zip\", compression=zipfile.ZIP_DEFLATED) as zip_f:\n", | ||
" zip_f.extractall(\"airbnb_data\")\n", | ||
"print(\"Done!\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%pip install pandas matplotlib pytorch" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pandas as pd" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Load the data (will take a short while)\n", | ||
"calendar = pd.read_csv(\"airbnb_data/calendar.csv\")\n", | ||
"demographics = pd.read_csv(\"airbnb_data/demographics.csv\")\n", | ||
"econ_state = pd.read_csv(\"airbnb_data/econ_state.csv\")\n", | ||
"listings = pd.read_csv(\"airbnb_data/listings.csv\")\n", | ||
"real_estate = pd.read_csv(\"airbnb_data/real_estate.csv\")\n", | ||
"venues = pd.read_csv(\"airbnb_data/venues.csv\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Your Hack ..." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"calendar.loc[calendar[\"listing_id\"] == 2515].plot(x=\"date\", y=\"price\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# todo: make something awesome ..." | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"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.7.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |