how to calculate the sum of all values from one day in a time series in pd pivot? My pandas pivot looks like this:
Date 2019-10-01 2019-10-02 2019-10-03 .... 2019-12-01
Hospital_name
Hospital1 12 15 16 .... 12
Hospital2 10 17 14 .... 12
Hospital3 15 20 12 .... 12
and I want to pivot such like this:
Date 2019-10-01 2019-10-02 2019-10-03 .... 2019-12-01
Sum 37 52 42 .... 36
My data type is:
type(df.columns[0])
out: str
type(df.columns[1])
out: pandas._libs.tslibs.timestamps.Timestamp
Thanks for your help!