Skip to content

Commit d594fef

Browse files
committed
Add build_table for dash
1 parent 70c879b commit d594fef

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/penn_chime/charts.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,12 @@ def build_sim_sir_w_date_chart(
125125
.configure_legend(orient="bottom")
126126
.interactive()
127127
)
128+
129+
130+
def build_table(
131+
*, df: pd.DataFrame, labels: Dict[str, str], modulo: int = 1
132+
) -> pd.DataFrame:
133+
table_df = df[np.mod(df.day, modulo) == 0].copy()
134+
table_df.date = table_df.date.dt.strftime(DATE_FORMAT)
135+
table_df.rename(labels)
136+
return table_df

0 commit comments

Comments
 (0)