I found an alternate answer here
link
My dataframe currently looks like this
date new_cases new_deaths new_tests year month day weekday
0 2019-12-31 0.0 0.0 NaN 2019 12 31 1
1 2020-01-01 0.0 0.0 NaN 2020 1 1 2
2 2020-01-02 0.0 0.0 NaN 2020 1 2 3
I want to pass an code which will average out the 'new_cases' for weekday and weekend my code currently look like this but I can only pass 1 condition which is ' == 6 '. I want to pass multiple criteria, for example, == (4,5,6)
covid_df[covid_df.weekday == 6].new_cases.mean()
Any clue?