pydata/pandas — pull request #8964 by jamalsenouci (2014-12-02 11:45:28+00:00)
Title: BUG: fixes pd.Grouper for non-datetimelike groupings #8866

The bug was caused by a couple of things, firstly when specifying only a level, the axis default was None. This meant it failed to create the internal grouper breaking on line 254:
```python
ax = obj._get_axis(self.axis)
```
Secondly, the aggregate function is set up to take a basegrouper class whereas for datetime resampling we need to pass a datetime index. I split the ```_set_grouper``` method to return a datetime index when a resampling frequency is specified and a ```BaseGrouper``` class otherwise. I opted to split that out into two functions to reduce complexity with much of the ```_set_basegrouper``` function being borrowed from the ```_get_grouper``` function. Let me know if there's a better way to fix this.