@@ -485,15 +485,16 @@ def draw_projected_admissions_table(
485
485
return None
486
486
487
487
488
- def draw_census_table (st , census_df : pd .DataFrame , labels , day_range , as_date : bool = False ):
488
+ def draw_census_table (
489
+ st , census_df : pd .DataFrame , labels , day_range , date_first_hospitalized : Optional [date ] = None , as_date : bool = False ):
489
490
census_table = census_df [np .mod (census_df .index , day_range ) == 0 ].copy ()
490
491
census_table .index = range (census_table .shape [0 ])
491
492
census_table .loc [0 , :] = 0
492
493
census_table = census_table .dropna ().astype (int )
493
494
494
495
if as_date :
495
496
census_table = add_date_column (
496
- census_table , drop_day_column = True , date_format = DATE_FORMAT
497
+ census_table , date_first_hospitalized , drop_day_column = True , date_format = DATE_FORMAT
497
498
)
498
499
499
500
census_table .rename (labels )
@@ -510,7 +511,7 @@ def draw_raw_sir_simulation_table(st, model, parameters):
510
511
511
512
if as_date :
512
513
infect_table = add_date_column (
513
- infect_table , drop_day_column = True , date_format = DATE_FORMAT
514
+ infect_table , parameters . date_first_hospitalized , drop_day_column = True , date_format = DATE_FORMAT
514
515
)
515
516
516
517
st .table (infect_table )
@@ -522,7 +523,7 @@ def draw_raw_sir_simulation_table(st, model, parameters):
522
523
523
524
def build_download_link (st , filename : str , df : pd .DataFrame , parameters : Parameters ):
524
525
if parameters .as_date :
525
- df = add_date_column (df , drop_day_column = True , date_format = "%Y-%m-%d" )
526
+ df = add_date_column (df , parameters . date_first_hospitalized , drop_day_column = True , date_format = "%Y-%m-%d" )
526
527
527
528
csv = dataframe_to_base64 (df )
528
529
st .markdown ("""
0 commit comments