Skip to content

Commit 93c11c1

Browse files
Chore: Completed Task-3 Dashboard for the Level-3
1 parent 878ad46 commit 93c11c1

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

app.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from sklearn.tree import DecisionTreeRegressor
1212
from sklearn.ensemble import RandomForestRegressor
1313
from sklearn.metrics import mean_squared_error, r2_score
14-
import plotly.graph_objs as go
1514

1615

1716
# Define the tasks for each level
@@ -23,6 +22,7 @@
2322

2423
# Create the Streamlit web app
2524
def main():
25+
st.set_page_config(page_title="Zomato Data Analysis", page_icon="🥘", layout="wide")
2626
st.title('Zomato Data Analysis')
2727

2828
st.sidebar.title('Navigation')
@@ -399,8 +399,26 @@ def main():
399399
st.markdown("- Determine if there are any specific cuisines that tend to receive higher ratings")
400400
top_cuisines = cuisine_ratings.head(10)
401401
st.write('Top 10 cuisines with highest ratings:\n', top_cuisines)
402+
403+
404+
if selected_task == 'Task 3' and selected_level == 'Level 3':
405+
st.write("Restaurant Ratings Analysis")
406+
df = pd.read_csv("./data/data.csv")
407+
408+
st.write("### Distribution of Aggregate Rating")
409+
st.plotly_chart(px.histogram(df, x='Aggregate rating', nbins=20, title='Distribution of Aggregate Rating'))
410+
411+
st.write("### Average Rating by Cuisine")
412+
st.plotly_chart(px.bar(df, x='Cuisines', y='Aggregate rating', title='Average Rating by Cuisine'))
413+
414+
st.write("### Aggregate Rating by City")
415+
st.plotly_chart(px.violin(df, y='Aggregate rating', x='City', box=True, points='all', title='Aggregate Rating by City'))
402416

417+
st.write("### Hexbin Plot of Ratings by Location")
418+
st.plotly_chart(px.density_heatmap(df, x='Longitude', y='Latitude', z='Aggregate rating', nbinsx=30, nbinsy=30, title='Hexbin Plot of Ratings by Location'))
403419

420+
st.write("### Bubble Plot of Ratings vs Votes")
421+
st.plotly_chart(px.scatter(df, x='Votes', y='Aggregate rating', size='Price range', color='City', hover_name='Restaurant Name', title='Bubble Plot of Ratings vs Votes'))
404422

405423

406424
if __name__ == '__main__':

0 commit comments

Comments
 (0)