Skip to content
Open
Show file tree
Hide file tree
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
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions DataTreatment.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ def change_regname(x):


path = './data/raw/intake/'

os.makedirs(path, exist_ok=True)

dfs = []
Expand Down
67 changes: 3 additions & 64 deletions Plotting.py
Original file line number Diff line number Diff line change
@@ -1,49 +1,20 @@
#!/usr/bin/env python
# coding: utf-8

# In[14]:


from __future__ import division
from matplotlib import *
import numpy as np
import operator
import geopandas as gpd
import shapely
import streamlit as st


# In[15]:


#pandas and matplotlib
#%matplotlib inline

import pandas as pd
import csv
from matplotlib import pyplot as plt
from collections import Counter, defaultdict
import collections as col


# In[16]:


#data management

import os, sys, glob, re, calendar, datetime
from matplotlib.pyplot import cm
import matplotlib.ticker as ticker
import matplotlib.dates as mdates
from datetime import date, timedelta
from time import sleep
from matplotlib import gridspec

import os

# ## Get Data

# In[17]:


from scipy.stats import beta
def clopper_pearson(p,n):
alpha = 0.05
Expand All @@ -62,16 +33,8 @@ def clopper_pearson(p,n):
d = pd.DataFrame.from_dict([ci_u, ci_o])
return d


# In[18]:


rescaling = 1000


# In[19]:


input_dir = 'data/dashboard'

# get epi values
Expand All @@ -80,8 +43,6 @@ def clopper_pearson(p,n):
wau = pd.read_csv(os.path.join(input_dir, 'active_users.csv'), index_col=0, header=0).squeeze()


# In[20]:


# get participants values

Expand All @@ -99,24 +60,12 @@ def clopper_pearson(p,n):
age= age.reindex(['<18','18-40','41-65','>65'])



# In[21]:


st.title("Incidenza da sindromi simil-influenzali")


# In[22]:


st.write("In questa sezione potete trovare i dati aggiornati raccolti da Influweb per quanto riguarda i sintomi influenzali.")

st.write("Il grafico riportato qui sotto mostra la curva di incidenza dei probabili casi di sindrome simil-influenzale (ILI) e casi di sindrome respiratoria acuta (ARI) osservati in tutta Italia nell'ultimo anno. La curva continua rappresenta una stima dell'incidenza nella settimana corrente, l'area transparente rappresenta l'incertezza del 95% sulla stima.")




# In[23]:
st.write("Il grafico riportato qui sotto mostra la curva di incidenza dei probabili casi di sindrome simil-influenzale (ILI) e casi di sindrome respiratoria acuta (ARI) osservati in tutta Italia nell'ultimo anno. La curva continua rappresenta una stima dell'incidenza nella settimana corrente, l'area trasparente rappresenta l'incertezza del 95% sulla stima.")


# Initialise variable
Expand Down Expand Up @@ -146,18 +95,13 @@ def clopper_pearson(p,n):
st.pyplot(fig2)


# In[24]:


st.title("Composizione demografica dei partecipanti")

st.write("In questa sezione mostriamo le caratteristiche demografiche dei partecipanti nella stagione corrente.")
st.write("I grafici riportati qui sotto mostrano la composizione demograficha in termini di genere, età, educazione e occupazione.")


# In[25]:


#https://coolors.co/palette/220901-621708-941b0c-bc3908-f6aa1c
fig3,ax3=plt.subplots(figsize=(10,7),nrows=2,ncols=2)

Expand Down Expand Up @@ -185,16 +129,13 @@ def clopper_pearson(p,n):
st.pyplot(fig3)


# In[ ]:


st.title("Aspetti geografici")
st.write("La prima mappa mostra l'incidenza cumulativa nella stagione 2023-2024 dei probabili casi di sindrome simil-influenzale (ILI) riportati in ogni regione dai partecipanti di InfluWeb.")

st.write("La seconda mappa mostra la copertura regionale dei partecipanti in ogni regione espressa come numero di partecipanti per 100,000 abitanti.")


# In[45]:


df = gpd.read_file(os.path.join(input_dir, 'reg_map.csv'), ignore_geometry=True)
Expand All @@ -207,7 +148,6 @@ def clopper_pearson(p,n):
gdf = gpd.GeoDataFrame(df)


# In[48]:


tab4, tab5 = st.tabs(["ILI attack rate", "Partecipanti"])
Expand All @@ -227,7 +167,6 @@ def clopper_pearson(p,n):
st.pyplot(fig5)


# In[ ]:



Expand Down
Binary file added data/.DS_Store
Binary file not shown.
28 changes: 28 additions & 0 deletions data/dashboard/ARI_incidence.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
,incidence
2023-44,4.76
2023-45,25.46
2023-46,38.03
2023-47,52.98
2023-48,61.4
2023-49,67.83
2023-50,58.82
2023-51,44.05
2023-52,35.56
2024-01,37.69
2024-02,35.79
2024-03,31.18
2024-04,33.33
2024-05,26.91
2024-06,31.96
2024-07,34.97
2024-08,42.25
2024-09,30.44
2024-10,30.66
2024-11,23.7
2024-12,26.25
2024-13,21.79
2024-14,17.16
2024-15,27.23
2024-16,37.13
2024-17,21.0
2024-18,8.09
28 changes: 28 additions & 0 deletions data/dashboard/ILI_incidence.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
,incidence
2023-44,2.38
2023-45,9.26
2023-46,17.9
2023-47,13.25
2023-48,21.93
2023-49,19.69
2023-50,37.04
2023-51,33.04
2023-52,24.44
2024-01,15.52
2024-02,6.71
2024-03,13.36
2024-04,20.0
2024-05,11.21
2024-06,2.28
2024-07,2.33
2024-08,16.43
2024-09,9.37
2024-10,7.08
2024-11,11.85
2024-12,4.77
2024-13,7.26
2024-14,4.9
2024-15,7.43
2024-16,7.43
2024-17,10.5
2024-18,0.0
28 changes: 28 additions & 0 deletions data/dashboard/active_users.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
,active users
2023-44,420
2023-45,432
2023-46,447
2023-47,453
2023-48,456
2023-49,457
2023-50,459
2023-51,454
2023-52,450
2024-01,451
2024-02,447
2024-03,449
2024-04,450
2024-05,446
2024-06,438
2024-07,429
2024-08,426
2024-09,427
2024-10,424
2024-11,422
2024-12,419
2024-13,413
2024-14,408
2024-15,404
2024-16,404
2024-17,381
2024-18,371
5 changes: 5 additions & 0 deletions data/dashboard/age.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
age_class,count
41-65,1348
>65,489
18-40,431
<18,132
7 changes: 7 additions & 0 deletions data/dashboard/education.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
edu,count
master_phd,1021
high_school,889
bachelor,177
int_school,166
none,95
student,52
4 changes: 4 additions & 0 deletions data/dashboard/gender.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gender,count
Male,1317
Female,1078
Other,5
10 changes: 10 additions & 0 deletions data/dashboard/occupation.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
occupation,count
full_time,946
retired,534
self-employed,283
student,249
part_time,148
homemaker,91
unemployed,81
other,58
on leave,10
21 changes: 21 additions & 0 deletions data/dashboard/reg_map.csv

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: myenv
name: influweb-dashboard
channels:
- conda-forge
- anaconda
- defaults
dependencies:
- numpy=1.26.4=py310heeff2f4_0
- geopandas=0.14.4=pyhd8ed1ab_0
- pgeocode=0.4.1=pyhd8ed1ab_0
- pandas=2.2.2=py310h6a678d5_0
- numpy=1.26.4
- geopandas=0.14.4
- pgeocode=0.4.1
- pandas=2.2.2
- streamlit=1.39.0