Spaces:
Runtime error
Runtime error
File size: 1,481 Bytes
6e748ab |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
import os
import shutil
import gdown
import pandas as pd
import plotly.express as px
import streamlit as st
@st.cache
def get_data():
# Download file from Google Drive
# This file is based on data from: http://insideairbnb.com/get-the-data/
file_id_1 = "1rsxDntx9CRSyDMy_fLHEI5Np4lB153sa"
downloaded_file_1 = "listings.pkl"
gdown.download(id=file_id_1, output=downloaded_file_1)
# Read a Python Pickle file
return pd.read_pickle("listings.pkl")
df = get_data()
st.title("The Airbnb dataset of Amsterdam")
st.markdown(
"The dataset contains slight modifications with regards to the original for illustrative purposes"
)
st.dataframe(df.head(100))
st.text("The dataset was retrieved using the following code:")
st.code(
"""
@st.cache
def get_data():
# Download file from Google Drive
# This file is based on data from: http://insideairbnb.com/get-the-data/
file_id_1 = "1f6o9IeaieH_xXyghjnREfl2dC44pIUc4"
downloaded_file_1 = "listings.pkl"
gdown.download(id=file_id_1, output=downloaded_file_1)
# Read a Python Pickle file
return pd.read_pickle("listings.pkl")
""",
language="python",
)
st.markdown(
"*Let's take a closer look at the supposed relation between **price_in_dollar** and **review_scores_rating**.*"
)
st.plotly_chart(
px.scatter(
df,
x="price_in_dollar",
y="review_scores_rating",
trendline="ols",
trendline_color_override="orange",
)
)
|