-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstrrrr.py
More file actions
70 lines (55 loc) · 1.69 KB
/
strrrr.py
File metadata and controls
70 lines (55 loc) · 1.69 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
import streamlit as st
import pandas as pd
import plotly.express as px
st.set_page_config(page_title="Analytics Dashboard", layout="wide")
st.sidebar.title("Navigation")
page = st.sidebar.radio("Go to", ["Descriptives", "Sales", "Profit"])
descriptives_data = pd.DataFrame({
'Category': ['A', 'B', 'C', 'D'],
'Values': [23, 45, 12, 67]
})
sales_data = pd.DataFrame({
'best_seller_tag__y_or_n': ['Yes', 'No', 'Yes', 'No'],
'sales_price': [100, 50, 150, 70]
})
profit_data = pd.DataFrame({
'Region': ['North', 'South', 'East', 'West'],
'Profit': [200, 300, 150, 400]
})
# Descriptives Page
if page == "Descriptives":
st.title("Descriptives")
st.subheader("Descriptive Statistics")
st.write(descriptives_data.describe())
fig = px.bar(
descriptives_data,
x='Category',
y='Values',
title="Category Values",
color_discrete_sequence=['blue']
)
st.plotly_chart(fig)
# Sales Page
elif page == "Sales":
st.title("Sales Analysis")
fig = px.bar(
sales_data,
x='best_seller_tag__y_or_n',
y='sales_price',
title="Sales Price by Best Seller Tag",
labels={'best_seller_tag__y_or_n': 'Best Seller (Y/N)', 'sales_price': 'Sales Price'},
color_discrete_sequence=['orange']
)
st.plotly_chart(fig)
# Profit Page
elif page == "Profit":
st.title("Profit Analysis")
fig = px.bar(
profit_data,
x='Region',
y='Profit',
title="Profit by Region",
labels={'Region': 'Region', 'Profit': 'Profit'},
color_discrete_sequence=['green']
)
st.plotly_chart(fig)