Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions italy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import streamlit as st
import pandas as pd
import plotly.express as px
import datetime

header = st.beta_container()
dataset = st.beta_container()
Expand All @@ -19,40 +20,47 @@
st.write(data_graph.head())

st.subheader('Total of Doses by Supplier')
doses = pd.DataFrame(data_graph.groupby(["supplier"])["first_dose","second_dose"].sum()).head(50)
doses = pd.DataFrame(data_graph.groupby(["supplier"])["first_dose","second_dose"].sum()).head()
st.bar_chart(doses)

st.subheader('Total of Doses by Region')
regions = pd.DataFrame(data_graph.groupby(["region_name"])["Total_doses"].sum()).head(50)
regions = pd.DataFrame(data_graph.groupby(["region_name"])["Total_doses"].sum()).head()
st.bar_chart(data=regions)

st.subheader('Choose the Best combination between date and age range for you')
st.sidebar.subheader('Choose the Best combination between date and age range for you')
st.subheader('Combination between date and age range for you')

data_graph['administration_date'] = pd.to_datetime(data_graph['administration_date']).dt.strftime('%Y-%m-%d')
start_date = pd.Timestamp(st.sidebar.date_input('Start date', datetime.date(2020,12,27), min_value=datetime.date(2020,12,27), max_value=datetime.date(2021,5,19)))
end_date = pd.Timestamp(st.sidebar.date_input('End date', datetime.date(2021,5,25), min_value=datetime.date(2021,5,25), max_value=datetime.date(2021,5,20)))
data_graph = data_graph.loc[(data_graph['administration_date']>= start_date) & (data_graph['administration_date']<= end_date),:]

age_options = data_graph['age_range'].unique().tolist()
#def vis(filter_data,list_countries,dt_choice_normal, dt_choice_cases, start_date, end_date,df_pop):
#filter_data['Date'] = pd.to_datetime(filter_data['Date'], format='%m/%d/%y')
#filter_data = filter_data.loc[(filter_data['Date'] >= start_date) & (filter_data['Date'] <= end_date),:]
date_options = data_graph['administration_date'].unique().tolist()

date = st.selectbox("Which date would you like to see", date_options,100)
age = st.multiselect("Which Age Range would you like to see", age_options, ['80-89'])
start_date = pd.Timestamp(st.sidebar.date_input('Start date', datetime.date(2020,12,27), min_value=datetime.date(2020,12,27), max_value=datetime.date(2021,5,19)))
age = st.sidebar.multiselect("Which Age Range would you like to see", age_options, ['80-89'])

data_graph = data_graph[data_graph['age_range'].isin(age)]
data_graph = data_graph[data_graph['administration_date']==date]
data_graph = data_graph[data_graph['administration_date']]

fig2 = px.bar(data_graph,x="age_range",y="Total_doses",color="age_range", range_y=[0,35000])

fig2.update_layout(width=800)

st.write(fig2)

st.subheader('Choose the Best combination between supplier and age range for you')

st.sidebar.subheader('Choose the Best combination between supplier and age range for you')
st.subheader('Combination between supplier and age range for you')

supplier_options = data_graph['supplier'].unique().tolist()
age_option = data_graph['age_range'].unique().tolist()
age_option2 = data_graph['age_range'].unique().tolist()

suppliers = st.selectbox("Which supplier would you like to see", supplier_options,1)
age2 = st.multiselect("Which Age Range would you like to see", age_option, ['80-89'])
age2 = st.sidebar.multiselect("Which Age Range would you like to see", age_option2, ['80-89'])
suppliers = st.sidebar.selectbox("Which supplier would you like to see", supplier_options,1)

data_graph = data_graph[data_graph['age_range'].isin(age2)]
data_graph = data_graph[data_graph['supplier']==suppliers]
Expand Down