parameters: (self, ascending: bool = True)
docstring: Number each item in each group from 0 to the length of that group - 1.
  
          Essentially this is equivalent to
  
          .. code-block:: python
  
              self.apply(lambda x: pd.Series(np.arange(len(x)), x.index))
  
          Parameters
          ----------
          ascending : bool, default True
              If False, number in reverse, from length of group - 1 to 0.
  
          Returns
          -------
          Series
              Sequence number of each element within each group.
  
          See Also
          --------
          .ngroup : Number the groups themselves.
  
          Examples
          --------
          >>> df = pd.DataFrame([['a'], ['a'], ['a'], ['b'], ['b'], ['a']],
          ...                   columns=['A'])
          >>> df
             A
          0  a
          1  a
          2  a
          3  b
          4  b
          5  a
          >>> df.groupby('A').cumcount()
          0    0
          1    1
          2    2
          3    0
          4    1
          5    3
          dtype: int64
          >>> df.groupby('A').cumcount(ascending=False)
          0    3
          1    2
          2    1
          3    1
          4    0
          5    0
          dtype: int64
docstring_summary: Number each item in each group from 0 to the length of that group - 1.
docstring_tokens: Number each item in each group from 0 to the length of that group - 1 .
function: def cumcount(self, ascending: bool = True):
          """
          Number each item in each group from 0 to the length of that group - 1.
  
          Essentially this is equivalent to
  
          .. code-block:: python
  
              self.apply(lambda x: pd.Series(np.arange(len(x)), x.index))
  
          Parameters
          ----------
          ascending : bool, default True
              If False, number in reverse, from length of group - 1 to 0.
  
          Returns
          -------
          Series
              Sequence number of each element within each group.
  
          See Also
          --------
          .ngroup : Number the groups themselves.
  
          Examples
          --------
          >>> df = pd.DataFrame([['a'], ['a'], ['a'], ['b'], ['b'], ['a']],
          ...                   columns=['A'])
          >>> df
             A
          0  a
          1  a
          2  a
          3  b
          4  b
          5  a
          >>> df.groupby('A').cumcount()
          0    0
          1    1
          2    2
          3    0
          4    1
          5    3
          dtype: int64
          >>> df.groupby('A').cumcount(ascending=False)
          0    3
          1    2
          2    1
          3    1
          4    0
          5    0
          dtype: int64
          """
          with group_selection_context(self):
              index = self._selected_obj._get_axis(self.axis)
              cumcounts = self._cumcount_array(ascending=ascending)
              return self._obj_1d_constructor(cumcounts, index)
function_tokens: def cumcount ( self , ascending : bool = True ) : with group_selection_context ( self ) : index = self . _selected_obj . _get_axis ( self . axis ) cumcounts = self . _cumcount_array ( ascending = ascending ) return self . _obj_1d_constructor ( cumcounts , index )