streamlit_dashboard / pages /platform_usage.py
Ashar086's picture
Update pages/platform_usage.py
8898617 verified
raw
history blame contribute delete
508 Bytes
import streamlit as st
import pandas as pd
import plotly.express as px
# Load dataset
df = pd.read_csv("Cleaned_Dataset.csv")
# Title
st.title("๐Ÿ“ˆ Platform Usage Patterns")
# Daily Usage Trends
st.subheader("Daily Usage Trends")
df['Watch Hour'] = pd.to_datetime(df['Watch Time']).dt.hour
hourly_usage = df.groupby('Watch Hour').size().reset_index(name='Count')
fig_line = px.line(hourly_usage, x='Watch Hour', y='Count', title="Hourly Usage Trends")
st.plotly_chart(fig_line, use_container_width=True)