def _reduce(self, op, name, axis=<NUM_LIT:0>, skipna=True, numeric_only=None,<EOL>filter_type=None, **kwds):
delegate = self._values<EOL>if axis is not None:<EOL><INDENT>self._get_axis_number(axis)<EOL><DEDENT>if isinstance(delegate, Categorical):<EOL><INDENT>return delegate._reduce(name, numeric_only=numeric_only, **kwds)<EOL><DEDENT>elif isinstance(delegate, ExtensionArray):<EOL><INDENT>return delegate._reduce(name, skipna=skipna, **kwds)<EOL><DEDENT>elif is_datetime64_dtype(delegate):<EOL><INDENT>delegate = DatetimeIndex(delegate)<EOL><DEDENT>elif isinstance(delegate, np.ndarray):<EOL><INDENT>if numeric_only:<EOL><INDENT>raise NotImplementedError('<STR_LIT>'<EOL>'<STR_LIT>'.format(name))<EOL><DEDENT>with np.errstate(all='<STR_LIT:ignore>'):<EOL><INDENT>return op(delegate, skipna=skipna, **kwds)<EOL><DEDENT><DEDENT>return delegate._reduce(op=op, name=name, axis=axis, skipna=skipna,<EOL>numeric_only=numeric_only,<EOL>filter_type=filter_type, **kwds)<EOL>
Perform a reduction operation.

If we have an ndarray as a value, then simply perform the operation,
otherwise delegate to the object.