def groups(self):
        """Returns dict {group name -> group labels}."""
        self._prep_pandas_groupby()

        def extract_group_labels(frame):
            return (frame[0], frame[1].index.values)

        return self._mergedRDD.map(extract_group_labels).collectAsMap()