class_docstr: Starts a new GroupBy operation.
class_docstr_tok: ["Starts","a","new","GroupBy","operation","."]
docstr: Apply a custom/user-defined function (UDF) over the groups as a sub-DataFrame.
  
  .. deprecated:: 0.19.0
      This method has been renamed to :func:`GroupBy.map_groups`.
  
  Parameters
  ----------
  function
      Custom function.
docstr_tok: ["Apply","a","custom\/user-defined","function","(","UDF",")","over","the","groups","as","a","sub-DataFrame",".","..","deprecated",":",":","0.19.0","This","method","has","been","renamed","to",":","func",":","`","GroupBy.map_groups","`",".","Parameters","--","--","--","--","--","function","Custom","function","."]
code: def apply(
      self, function: Callable[[DataFrame], DataFrame]
  ) -> DataFrame:
      """
      Apply a custom/user-defined function (UDF) over the groups as a sub-DataFrame.
  
      .. deprecated:: 0.19.0
          This method has been renamed to :func:`GroupBy.map_groups`.
  
      Parameters
      ----------
      function
          Custom function.
  
      """
      return self.map_groups(function)
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Callable, Iterable, Iterator
  import polars._reexport
  from polars import functions
  from polars.utils.convert import _timedelta_to_pl_duration
  from polars.utils.deprecation import deprecate_renamed_function
label_desc: Use image node_id 19 for calling the GroupBy obj's underlying member method code with example usage: obj.apply(function) and returns: self