-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
28 lines (22 loc) · 791 Bytes
/
app.py
File metadata and controls
28 lines (22 loc) · 791 Bytes
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
import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Load Data
df = pd.read_csv("amazon_products.csv")
# Streamlit Web UI
st.title("Amazon Soft Toys Data Analysis")
# Brand Analysis
st.subheader("Top 5 Brands by Product Count")
brand_counts = df["Brand"].value_counts().head(5)
st.bar_chart(brand_counts)
# Price vs Rating Analysis
st.subheader("Price vs Rating Analysis")
fig, ax = plt.subplots()
sns.scatterplot(data=df, x="Price", y="Rating", alpha=0.6, ax=ax)
st.pyplot(fig)
# Most Reviewed Products
st.subheader("Top 5 Products by Review Count")
top_reviews = df.sort_values("Reviews", ascending=False).head(5)
st.table(top_reviews[["Title", "Reviews", "Rating", "Price"]])
st.write("Explore more insights with interactive charts!**")