@@ -381,12 +381,9 @@ def show_additional_projections(
381
381
382
382
383
383
def draw_projected_admissions_table (
384
- st , projection_admits : pd .DataFrame , labels , as_date : bool = False , daily_count : bool = False ,
384
+ st , projection_admits : pd .DataFrame , labels , day_range , as_date : bool = False
385
385
):
386
- if daily_count == True :
387
- admits_table = projection_admits [np .mod (projection_admits .index , 1 ) == 0 ].copy ()
388
- else :
389
- admits_table = projection_admits [np .mod (projection_admits .index , 7 ) == 0 ].copy ()
386
+ admits_table = projection_admits [np .mod (projection_admits .index , day_range ) == 0 ].copy ()
390
387
admits_table ["day" ] = admits_table .index
391
388
admits_table .index = range (admits_table .shape [0 ])
392
389
admits_table = admits_table .fillna (0 ).astype (int )
@@ -400,11 +397,8 @@ def draw_projected_admissions_table(
400
397
return None
401
398
402
399
403
- def draw_census_table (st , census_df : pd .DataFrame , labels , as_date : bool = False , daily_count : bool = False ):
404
- if daily_count == True :
405
- census_table = census_df [np .mod (census_df .index , 1 ) == 0 ].copy ()
406
- else :
407
- census_table = census_df [np .mod (census_df .index , 7 ) == 0 ].copy ()
400
+ def draw_census_table (st , census_df : pd .DataFrame , labels , day_range , as_date : bool = False ):
401
+ census_table = census_df [np .mod (census_df .index , day_range ) == 0 ].copy ()
408
402
census_table .index = range (census_table .shape [0 ])
409
403
census_table .loc [0 , :] = 0
410
404
census_table = census_table .dropna ().astype (int )
0 commit comments