def _apply(self, func, **kwargs):
blocks, obj, index = self._create_blocks()<EOL>results = []<EOL>for b in blocks:<EOL><INDENT>try:<EOL><INDENT>values = self._prep_values(b.values)<EOL><DEDENT>except TypeError:<EOL><INDENT>results.append(b.values.copy())<EOL>continue<EOL><DEDENT>if values.size == <NUM_LIT:0>:<EOL><INDENT>results.append(values.copy())<EOL>continue<EOL><DEDENT>if isinstance(func, str):<EOL><INDENT>cfunc = getattr(libwindow, func, None)<EOL>if cfunc is None:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>".format(func=func))<EOL><DEDENT>def func(arg):<EOL><INDENT>return cfunc(arg, self.com, int(self.adjust),<EOL>int(self.ignore_na), int(self.min_periods))<EOL><DEDENT><DEDENT>results.append(np.apply_along_axis(func, self.axis, values))<EOL><DEDENT>return self._wrap_results(results, blocks, obj)<EOL>
Rolling statistical measure using supplied function. Designed to be
used with passed-in Cython array-based functions.

Parameters
----------
func : str/callable to apply

Returns
-------
y : same type as input argument