The resample method on its own, is unable to group by anything other than periods of time. The groupby method, however, has the ability to group by both periods of time and other columns.
Grouping by a Timestamp and another column
Getting ready
In this recipe, we will show two very similar but different approaches to group by Timestamps and another column.
How to do it...
- Read in the employee dataset, and create a DatetimeIndex with the HIRE_DATE column:
>>> employee = pd.read_csv('data/employee.csv',
parse_dates=['JOB_DATE...