Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dyedgreen committed Feb 21, 2020
0 parents commit 733de7d
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.zip
.ipynb_checkpoints

114 changes: 114 additions & 0 deletions template.ipynb
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
}

0 comments on commit 733de7d

Please sign in to comment.