BUG: grouping by tuple of values gives TypeError: unhashable type · Issue #18314 · pandas-dev/pandas (original) (raw)

@jorisvandenbossche

This example in the docs started failing somewhere since the last commits:

In [1]: business_dates = date_range(start='4/1/2014', end='6/30/2014', freq='B')

In [2]: df = DataFrame(1, index=business_dates, columns=['a', 'b'])

In [3]: df.groupby((df.index.year, df.index.month)).nth([0, 3, -1])
...
TypeError: unhashable type: 'Int64Index'