Be the following python pandas DataFrame:
| ID | Holidays | visit_1 | visit_2 | visit_3 | other |
|---|---|---|---|---|---|
| 0 | True | 1 | 2 | 0 | red |
| 0 | False | 3 | 2 | 0 | red |
| 0 | True | 4 | 4 | 1 | blue |
| 1 | False | 2 | 0 | 0 | red |
| 1 | True | 1 | 2 | 1 | green |
| 2 | False | 1 | 0 | 0 | red |
Currently I calculate a new DataFrame with the accumulated visit values as follows.
# Calculate the columns of the total visit count
visit_df = df.groupby('ID')[['visit_1', 'visit_2', 'visit_3']].sum()
I would like to create a new one taking into account only the rows whose Holiday value is True. How could I do this?