Covid time¶
Covidtracker¶
-
ratio(gb_data, data_depcode, data_ratio_hospitalises, current_date, data_hospitalises, current_date_file, min_value_80p, nbhospitalises_80p)¶ Creates an updated chart of the ratio of in-hospital deaths to hospitalizations in french departments.
- Parameters
gb_data (dataframe) – dataframe with covid data
data_depcode (list) – column ‘maille_nom’ of the dataframe
data_ratio_hospitalises (str) – (gb_data[‘deces’] / (gb_data[‘hospitalises’] + gb_data[‘gueris’])) * 100
:param current_date : gives the maximum date of the dataframe :type current_date : timestamp :param min_value_80p : data_hospitalises.loc[data_hospitalises[data_hospitalises.sort_values(ascending=False).cumsum() <= nbhospitalises_80p].index].min() :type min_value_80p : list :param nbhospitalises_80p : data_hospitalises.sum() * 0.80 :type nbhospitalises_80p : int
Analysis of COVID-19 progression in France¶
-
axis_date_limits(axs, min_date=None, max_date=None, format_date=None)¶ Tailor axis limits
-
data_preparation(data, maille_code, rows=['t', 'deces', 'deces_ehpad', 'reanimation', 'hospitalises', 'nouvelles_reanimations', 'nouvelles_hospitalisations'], no_negatives=['deces', 'deces_ehpad'])¶ -Format data -Adds colummns : reanimation_cumul, hospitalises_cumul,reanimation_solde_vivant_jour,reanimation_solde_vivant_jour_jour -Does a rolling average over data of hospitalization, deaths
-
download_france_data()¶ Download and merges data from OpenCovid19-fr and data.gouv.fr
-
enable_time_series_plot(in_df, timein_field='time', timeseries_field_out='date', date_format='%Y-%m-%d')¶ Small tool to add a field to a dataframe which can be used for time series plotting
-
plot_field_loops(fra: pandas.core.frame.DataFrame, field: str, smoothing: List[int] = [7, 2, 3], maille_active='', start_date='2020-03-09', end_date=datetime.datetime(2021, 4, 20, 21, 58, 48, 618953), **kwargs)¶ Plots the day on day delta of a field of ‘fra’ against Args:
fra ([type]): [description] field ([type]): [description] smoothing (list, optional): [description]. Defaults to [7, 2, 3]. maille_active (str, optional): [description]. Defaults to “”. start_date (str, optional): [description]. Defaults to “2020-03-09”. end_date ([type], optional): [description]. Defaults to last_tuesday().
Gifs¶
-
adapt_time(data)¶ Removes the date given with a wrong foramt Changes dates into timestamp format
-
data_treatment_by_option(data_granu, option)¶ Adjusts dataframe to set pandas_alive package requirements as arguments Resamples data so we take into acount rows with option =! 0
-
plot_animation(df_clean, granu, option)¶ Creates an animation with pandas_alive package. :param df_clean: dataframe with covid data :type gb_data: dataframe :param granu: column ‘maille_nom’ of the dataframe :type granu: list :param option : deces or cas_confirmes :type option : list