#NEWLINE# def _head( self ) : #NEWLINE# #INDENT# '\n        Return a pd.DataFrameGroupBy / pd.SeriesGroupBy which contais head data.\n        ' #NEWLINE# head = self . obj . head ( ) #NEWLINE# if isinstance ( self . index , Series ) : #NEWLINE# #INDENT# if self . _is_grouped_by_sliced_column ( self . obj , self . index ) : #NEWLINE# #INDENT# grouped = head . groupby ( head [ self . index . name ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# grouped = head . groupby ( self . index . head ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# grouped = head . groupby ( head . index ) #NEWLINE# #UNINDENT# grouped = _maybe_slice ( grouped , self . _slice ) #NEWLINE# return grouped