def __init__(self): self.df_fra, self.df_fra_2, self.df_fra_backup = df_fct.import_df( ['Fra_GenData', 'Fra_GenData2', 'Fra_Backup'], ['raw', 'raw', 'raw']) self.df_fra_test = df_fct.import_df(['Fra_Testing2'], ['raw']) self.df_dpt_shp = df_fct.import_df(['Fra_Departements_shapefile'], ['raw'])[0] self.df_fra_nat = pandas.DataFrame() self.df_fra_reg = pandas.DataFrame() self.df_fra_dpt = pandas.DataFrame()
def __init__(self): variables = [ 'Fra_GenData', 'Fra_Regions_shapefile', 'Fra_Departements_shapefile', 'Fra_pop', 'Dept_reg' ] self.df_fra_reg = df_fct.import_df(['Fra_Reg'], ['processed'])[0] list_prop_import = ['raw', 'raw', 'raw', 'raw', 'raw'] for a_var, a_prop in zip(variables, list_prop_import): setattr(self, a_var, df_fct.import_df([a_var], [a_prop])[0]) self.df_fra = pandas.DataFrame() self.df_fra_dpt = pandas.DataFrame()
def __init__(self, prop_df, off_sets): self.world_df = df_fct.import_df(['World_JH'], ['processed'])[0] self.prop_df = prop_df self.result_reg = pandas.DataFrame(index=prop_df.index, columns=['df_cases', 'df_death']) self.off_sets = off_sets self.list_y = [] self.list_x_fit = []
def __init__(self): variables = ['World_JH', 'Countries_LatLong', 'World_pop'] list_prop_import = ['processed', 'raw', 'raw'] for a_var, a_prop in zip(variables, list_prop_import): setattr(self, a_var, df_fct.import_df([a_var], [a_prop])[0]) self.world_shpe = gpd.read_file( gpd.datasets.get_path('naturalearth_lowres'))
def __init__(self): variables = [ 'US_JH_cases', 'US_JH_death', 'US_States_shapefile', 'US_pop' ] list_prop_import = ['raw', 'raw', 'raw', 'raw'] for a_var, a_prop in zip(variables, list_prop_import): setattr(self, a_var, df_fct.import_df([a_var], [a_prop])[0]) self.df_us = pandas.DataFrame()
def __init__(self, style_cycle, intv, fig_size, plotting_dates, df_title): self.data_vax = df_fct.import_df(['Fra_Vax'],['processed'])[0] self.style_cycle = style_cycle self.intv = intv self.plotting_dates = [pandas.to_datetime(plotting_dates[0])] self.fig_size = fig_size self.df_title = df_title self.data_vax.sort_index(level=['nom','date'], inplace=True) if plotting_dates[1] == 'last': self.plotting_dates.append(self.data_vax.index.get_level_values('date').unique()[-2]) else: self.plotting_dates.append(pandas.to_datetime(plotting_dates[0]))
def __init__(self, cycle, list_countries, plotting_dates, intv, fig_size): self.world_df = df_fct.import_df(['World_JH'], ['processed'])[0] self.cycle = cycle self.list_countries = list_countries self.plotting_dates = [pandas.to_datetime(plotting_dates[0])] self.intv = intv self.root = os.path.dirname( os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) self.fig_size = fig_size if plotting_dates[1] == 'last': self.plotting_dates.append( self.world_df.index.get_level_values('date').unique()[-1]) else: self.plotting_dates.append(pandas.to_datetime(plotting_dates[0]))
def __init__(self, intv, fig_size, plotting_dates, style_cycle, df_title, para_to_plot): self.french_df = df_fct.import_df(['Fra_Nat'], ['processed'])[0] self.intv = intv self.style_cycle = style_cycle self.root = os.path.dirname( os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) self.df_title = df_title self.para_to_plot = para_to_plot self.plotting_dates = [pandas.to_datetime(plotting_dates[0])] self.fig_size = fig_size if plotting_dates[1] == 'last': self.plotting_dates.append( self.french_df.index.get_level_values('date').unique()[-1]) else: self.plotting_dates.append(pandas.to_datetime(plotting_dates[0]))
def __init__(self, style_cycle, intv, fig_size, country, name_df, plotting_dates, to_plot, df_title, plots_titles, data_source): self.style_cycle = style_cycle self.intv = intv self.country = country self.df = df_fct.import_df([name_df], ['processed'])[0] self.to_plot = to_plot self.df_title = df_title self.plots_titles = plots_titles self.data_source = data_source self.fig_size = fig_size self.plotting_dates = [pandas.to_datetime(plotting_dates[0])] if plotting_dates[1] == 'last': self.plotting_dates.append( self.df.index.get_level_values('date').unique()[-2]) else: self.plotting_dates.append(pandas.to_datetime(plotting_dates[0]))
def __init__(self, intv, fig_size, style_cycle, df, cut_off, idx_names, sort_by, drop, per_graph, para_to_plot, plotting_dates, name_plot, title_graph): self.intv = intv self.style_cycle = style_cycle self.data_df = df_fct.import_df([df], ['processed'])[0] self.cut_off = cut_off self.idx_names = idx_names self.sort_by = sort_by self.drop = drop self.per_graph = per_graph self.para_to_plot = para_to_plot self.plotting_dates = [pandas.to_datetime(plotting_dates[0])] self.name_plot = name_plot self.title_graph = title_graph self.fig_size = fig_size if plotting_dates[1] == 'last': self.plotting_dates.append( self.data_df.index.get_level_values('date').unique()[-1]) else: self.plotting_dates.append(pandas.to_datetime(plotting_dates[0]))
def __init__(self, I_para, R_para, intv, fig_size, plotting_dates, style_cycle, para_to_plot, legend_name): self.french_df = df_fct.import_df(['Fra_Nat_v2'], ['processed'])[0] self.I_para = I_para self.R_para = R_para self.intv = intv self.plotting_dates = [pandas.to_datetime(plotting_dates[0])] self.style_cycle = style_cycle self.root = os.path.dirname( os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) self.fig_size = fig_size self.para_to_plot = para_to_plot self.legend_name = [legend_name[key] for key in self.para_to_plot] self.pop = 67114995 if plotting_dates[1] == 'last': self.plotting_dates.append( self.french_df.index.get_level_values('date').unique()[-1]) else: self.plotting_dates.append(pandas.to_datetime(plotting_dates[0]))
def __init__(self): self.us_testing = df_fct.import_df(['US_Testing'], ['raw'])[0]
def __init__(self): self.fra_testing_1, self.fra_testing_2 = df_fct.import_df( ['Fra_Testing1', 'Fra_Testing2'], ['raw', 'raw']) self.fra_testing = pandas.DataFrame()
def __init__(self): self.data_vax = df_fct.import_df(['Fra_Vax'], ['raw'])[0]
def __init__(self): self.df_indic_nat = df_fct.import_df(['Fra_Indic_Nat'], ['raw'])[0] self.df_indic_dpt = df_fct.import_df(['Fra_Indic_Dpt'], ['raw'])[0] self.df_dpt_shp = df_fct.import_df(['Fra_Departements_shapefile'], ['raw'])[0]
def import_db(self): self.df_cases, self.df_death = df_fct.import_df( ['World_JH_cases', 'World_JH_death'], ['raw' for x in range(2)]) self.df_fra = df_fct.import_df(['Fra_Nat'], ['processed'])[0]