It is possible to group by using the values in the index instead of the columns. The sensor data is well suited for a hierarchical index, which can be used to demonstrate this concept. Let's set up a form of this data with a hierarchical index consisting of the sensor and axis columns:
Grouping can now be performed using the various levels of the hierarchical index. This code will group by index level 0 (the sensor names):
Grouping by multiple levels can be performed by passing the levels in a list. And if MultiIndex ...