Apply

def coarsen(self, windows, func, boundary='exact', side='left'):
        """
        Apply
        """
        windows = {k: v for k, v in windows.items() if k in self.dims}
        if not windows:
            return self.copy()

        reshaped, axes = self._coarsen_reshape(windows, boundary, side)
        if isinstance(func, str):
            name = func
            func = getattr(duck_array_ops, name, None)
            if func is None:
                raise NameError('{} is not a valid method.'.format(name))
        return type(self)(self.dims, func(reshaped, axis=axes), self._attrs)