I have a data frame with patient_ID, date_of_admission and Hospital_name. And I would like to create a second data frame that counts the number of patients by date.
My data frame
data = {'Patient_admitted_id': ['2323423', '234234234','234234234','324234234'],
'Date': ['2021-01-01', '2021-01-01','2021-01-01', '2021-01-02'],
'Hospital name' : ['Hospital1',"Hospital2","Hospital1", "Hospital3"]}
df = pd.DataFrame(data, columns=['Patient_admitted_id', 'Date', 'Hospital name' ])
Patient_admitted_id Date Hospital name
0 2323423 2021-01-01 Hospital1
1 234234234 2021-01-01 Hospital2
2 234234234 2021-01-01 Hospital1
3 324234234 2021-01-02 Hospital3
...
The data frame I am trying to create.
Date Cases
0 2021-01-01 3
1 2021-01-02 1
2 2021-01-03 0
...