File size: 1,681 Bytes
2aee853
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae51f3b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2aee853
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Hugging Face's logo
Hugging Face
Search models, datasets, users...
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing



Hugging Face is way more fun with friends and colleagues! 🤗 Join an organization
Spaces:

danielle2003
/
danielleAnge


like
0

App
Files
Community
Settings
danielleAnge
/
dash.py

danielle2003's picture
danielle2003
commit name
ae51f3b
about 3 hours ago
raw

Copy download link
history
blame
edit
delete

1.24 kB
import time
import plotly.express as px
import pandas as pd
import numpy as np
import streamlit as st

df = pd.read_csv('bank.csv')


st.set_page_config(page_title="Bank Data", page_icon="", layout="wide")

st.title("Bank Data Analysis")

job_filter = st.selectbox('Select Job', pd.unique(df['job']))

df_filtered = df[df['job'] == job_filter]

avg_age = np.mean(df_filtered['age'])
count_married = int(df_filtered['marital'].value_counts()['married'])

kp1, kp2, kp3 = st.columns(3)

kp1.metric(label="Average Age", value=round(avg_age), delta=round(avg_age) - 10)
kp2.metric(label="Married Count", value=count_married, delta=None)

st.subheader("Age vs Marital Status")
fig = px.density_heatmap(df_filtered, x="age", y="marital", nbinsx=20, nbinsy=5, color_continuous_scale="Blues")
st.plotly_chart(fig, use_container_width=True)
fig_col1,fig_col2 = st.columns(2)
with fig_col1:
    st.markdown('### first chart')
    fig1 = px.density_heatmap(data_frame = df,y='age',x='marital')
    st.write(fig1)
with fig_col2:
    st.markdown('### first chart')
    fig1 = px.histogram(data_frame = df,x='age')
    st.write(fig2)
st.dataframe(df)
st.markdown('### charts')

def main():
    st.header("welcome")

if __name__ == "__main__":
    main()