@Substitution(name='groupby')
    @Appender(_doc_template)
    def head(self, n=5):
        mask = self._cumcount_array() < n
        return self._selected_obj[mask]
Returns first n rows of each group.
dataset/ETHPy150Open pydata/pandas/pandas/core/groupby.py/GroupBy.head