# xarray.core.resample.DataArrayResample.map

#### DataArrayResample.map(func, args=(), shortcut=False, \*\*kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/resample.py#L308-L370)

Apply a function to each array in the group and concatenate them
together into a new array.

func is called like func(ar, \*args, \*\*kwargs) for each array ar
in this group.

Apply uses heuristics (like pandas.GroupBy.apply) to figure out how
to stack together the array. The rule is:

1. If the dimension along which the group coordinate is defined is
   still in the first grouped array after applying func, then stack
   over this dimension.
2. Otherwise, stack over the new dimension given by name of this
   grouping (the argument to the groupby function).

* **Parameters:**
  * **func** ([`callable()`](https://docs.python.org/3/builtins/functions.html#callable)) – Callable to apply to each array.
  * **shortcut** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool), *optional*) – Whether or not to shortcut evaluation under the assumptions that:
    1. The action of func does not depend on any of the array
       metadata (attributes or coordinates) but only on the data and
       dimensions.
    2. The action of func creates arrays with homogeneous metadata,
       that is, with the same dimensions and attributes.

    If these conditions are satisfied shortcut provides significant
    speedup. This should be the case for many common groupby operations
    (e.g., applying numpy ufuncs).
  * **args** ([`tuple`](https://docs.python.org/3/builtins/stdtypes.html#tuple), *optional*) – Positional arguments passed on to func.
  * **\*\*kwargs** – Used to call func(ar, \*\*kwargs) for each array ar.
* **Returns:**
  **applied** ([`DataArray`](xarray.DataArray.html.md#xarray.DataArray)) – The result of splitting, applying and combining this array.
