File size: 2,275 Bytes
70d9c5a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
import pandas as pd
import plotly.express as px

# Load the data
def load_data():
    file_path = 'digital_identity_data.xlsx'
    return pd.read_excel(file_path)

data = load_data()

# Streamlit app layout
st.title("Digital Identity Dashboard")

# Sidebar filters
st.sidebar.header("Filter Options")
country_filter = st.sidebar.multiselect("Select Countries:", options=data["Country"].unique(), default=data["Country"].unique())
gender_filter = st.sidebar.multiselect("Select Genders:", options=data["Gender"].unique(), default=data["Gender"].unique())
account_status_filter = st.sidebar.multiselect("Select Account Status:", options=data["Account Status"].unique(), default=data["Account Status"].unique())

# Apply filters
filtered_data = data[
    (data["Country"].isin(country_filter)) &
    (data["Gender"].isin(gender_filter)) &
    (data["Account Status"].isin(account_status_filter))
]

# Display filtered data
st.subheader("Filtered Data")
st.dataframe(filtered_data)

# Visualization: Number of logins by country
st.subheader("Number of Logins by Country")
logins_by_country = filtered_data.groupby("Country")["Number of Logins"].sum().reset_index()
fig = px.bar(logins_by_country, x="Country", y="Number of Logins", title="Logins by Country", color="Country")
st.plotly_chart(fig)

# Visualization: Session duration by gender
st.subheader("Average Session Duration by Gender")
session_duration_by_gender = filtered_data.groupby("Gender")["Session Duration (Minutes)"].mean().reset_index()
fig2 = px.bar(session_duration_by_gender, x="Gender", y="Session Duration (Minutes)", title="Session Duration by Gender", color="Gender")
st.plotly_chart(fig2)

# Visualization: Data breaches reported
st.subheader("Data Breaches Reported")
fig3 = px.pie(filtered_data, names="Country", values="Data Breaches Reported", title="Data Breaches by Country")
st.plotly_chart(fig3)

# Visualization: 2FA usage
st.subheader("2FA Adoption")
two_fa_usage = filtered_data["2FA Enabled"].value_counts().reset_index()
two_fa_usage.columns = ["2FA Enabled", "Count"]
fig4 = px.pie(two_fa_usage, names="2FA Enabled", values="Count", title="2FA Usage")
st.plotly_chart(fig4)

# Footer
st.markdown("---")
st.caption("Digital Identity Dashboard - Built with Streamlit")