Spaces:
Sleeping
Sleeping
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() | |