Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,8 +3,8 @@ import pandas as pd
|
|
| 3 |
import plotly.express as px
|
| 4 |
|
| 5 |
# Load your dataframes
|
| 6 |
-
|
| 7 |
-
|
| 8 |
|
| 9 |
# Function to generate treemap
|
| 10 |
def create_treemap(df, title):
|
|
@@ -14,11 +14,14 @@ def create_treemap(df, title):
|
|
| 14 |
# Streamlit app
|
| 15 |
st.title('Parental Guide Treemaps')
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
st.
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
import plotly.express as px
|
| 4 |
|
| 5 |
# Load your dataframes
|
| 6 |
+
df_tv_series= pd.read_csv('series_after_cleaning.csv')
|
| 7 |
+
df_movies= pd.read_csv('movie_after_cleaning.csv')
|
| 8 |
|
| 9 |
# Function to generate treemap
|
| 10 |
def create_treemap(df, title):
|
|
|
|
| 14 |
# Streamlit app
|
| 15 |
st.title('Parental Guide Treemaps')
|
| 16 |
|
| 17 |
+
# Split into two columns
|
| 18 |
+
col1, col2 = st.columns(2)
|
| 19 |
|
| 20 |
+
# Add buttons in each column
|
| 21 |
+
with col1:
|
| 22 |
+
if st.button('Movies'):
|
| 23 |
+
st.plotly_chart(create_treemap(df_movies, 'Parental Guide - Movies'))
|
| 24 |
+
|
| 25 |
+
with col2:
|
| 26 |
+
if st.button('TV Series'):
|
| 27 |
+
st.plotly_chart(create_treemap(df_tv_series, 'Parental Guide - TV Series'))
|