# pandas 3.1.0 (BSD-3-Clause), harvested by tools/harvest_corpus.py
=== input

    Internal function to reorder result if relabelling is True for
    dataframe.agg, and return the reordered result in dict.

    Parameters:
    ----------
    result: Result from aggregation
    func: Dict of (column name, funcs)
    columns: New columns name for relabelling
    order: New order for relabelling

    Examples
    --------
    >>> from pandas.core.apply import relabel_result
    >>> result = pd.DataFrame(
    ...     {"A": [np.nan, 2, np.nan], "C": [6, np.nan, np.nan], "B": [np.nan, 4, 2.5]},
    ...     index=["max", "mean", "min"],
    ... )
    >>> funcs = {"A": ["max"], "C": ["max"], "B": ["mean", "min"]}
    >>> columns = ("foo", "aab", "bar", "dat")
    >>> order = [0, 1, 2, 3]
    >>> result_in_dict = relabel_result(result, funcs, columns, order)
    >>> pd.DataFrame(result_in_dict, index=columns)
           A    C    B
    foo  2.0  NaN  NaN
    aab  NaN  6.0  NaN
    bar  NaN  NaN  4.0
    dat  NaN  NaN  2.5
    
=== parse numpydoc
short_description: |
  Internal function to reorder result if relabelling is True for
  dataframe.agg, and return the reordered result in dict.
long_description: |
  Parameters:
  ----------
  result: Result from aggregation
  func: Dict of (column name, funcs)
  columns: New columns name for relabelling
  order: New order for relabelling
blank_after_short_description: True
blank_after_long_description: True
style: numpydoc
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> from pandas.core.apply import relabel_result'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
    >>> result = pd.DataFrame(
    ...     {"A": [np.nan, 2, np.nan], "C": [6, np.nan, np.nan], "B": [np.nan, 4, 2.5]},
    ...     index=["max", "mean", "min"],
    ... )
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> funcs = {"A": ["max"], "C": ["max"], "B": ["mean", "min"]}'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> columns = ("foo", "aab", "bar", "dat")'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> order = [0, 1, 2, 3]'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> result_in_dict = relabel_result(result, funcs, columns, order)'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
    >>> pd.DataFrame(result_in_dict, index=columns)
           A    C    B
    foo  2.0  NaN  NaN
    aab  NaN  6.0  NaN
    bar  NaN  NaN  4.0
    dat  NaN  NaN  2.5
=== detect
numpydoc
=== compose numpydoc
Internal function to reorder result if relabelling is True for
dataframe.agg, and return the reordered result in dict.

Parameters:
----------
result: Result from aggregation
func: Dict of (column name, funcs)
columns: New columns name for relabelling
order: New order for relabelling

Examples
--------
>>> from pandas.core.apply import relabel_result
>>> result = pd.DataFrame(
...     {"A": [np.nan, 2, np.nan], "C": [6, np.nan, np.nan], "B": [np.nan, 4, 2.5]},
...     index=["max", "mean", "min"],
... )
>>> funcs = {"A": ["max"], "C": ["max"], "B": ["mean", "min"]}
>>> columns = ("foo", "aab", "bar", "dat")
>>> order = [0, 1, 2, 3]
>>> result_in_dict = relabel_result(result, funcs, columns, order)
>>> pd.DataFrame(result_in_dict, index=columns)
       A    C    B
foo  2.0  NaN  NaN
aab  NaN  6.0  NaN
bar  NaN  NaN  4.0
dat  NaN  NaN  2.5
