Skip to content

Commit

Permalink
add 2021 to mobility
Browse files Browse the repository at this point in the history
  • Loading branch information
francesconazzaro committed Mar 26, 2021
1 parent 151b28d commit a9a1cd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def sanitize(string):
break

area = col2.selectbox("Seleziona un'area", ['Italia'] + list(import_data.REGIONS_MAP.values()),
index=default_area_index + 1)
index=default_area_index + 1)

if what == 'Vaccini':
st.header(f"Dati sulle vaccinazioni aggiornati al {vaccines.administration[vaccines.administration.area == 'Italia'].index[-1].date()}")
Expand Down
7 changes: 4 additions & 3 deletions import_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ def select(self, sub_region_1, sub_region_2):

def get_mobility_country(country):
mobility_data_path = os.path.join(BASE_PATH, 'mobility')
mobility_country_path = os.path.join(mobility_data_path, f'2020_{country}_Region_Mobility_Report.csv')
mobility_country = pd.read_csv(mobility_country_path, index_col='date')
return Mobility(mobility_country)
mobility_country = pd.DataFrame()
for mobility_country_path in glob.glob(os.path.join(mobility_data_path, f'202*_{country}_Region_Mobility_Report.csv')):
mobility_country = mobility_country.append(pd.read_csv(mobility_country_path, index_col='date'))
return Mobility(mobility_country.sort_index())


class RepoReference:
Expand Down

0 comments on commit a9a1cd1

Please sign in to comment.