diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py index b2218c10a284e..350f81069bb60 100644 --- a/pandas/core/groupby.py +++ b/pandas/core/groupby.py @@ -1941,7 +1941,8 @@ def __init__(self, index, grouper=None, obj=None, name=None, level=None, # no level passed if not isinstance(self.grouper, (Series, Index, np.ndarray)): if getattr(self.grouper,'ndim', 1) != 1: - raise ValueError("Grouper result with an ndim != 1") + t = self.name or str(type(self.grouper)) + raise ValueError("Grouper for '%s' not 1-dimensional" % t) self.grouper = self.index.map(self.grouper) if not (hasattr(self.grouper, "__len__") and len(self.grouper) == len(self.index)):