MCPcopy
hub / github.com/pandas-dev/pandas / _reduce

Method _reduce

pandas/core/arrays/datetimes.py:2313–2324  ·  view source on GitHub ↗
(
        self, name: str, *, skipna: bool = True, keepdims: bool = False, **kwargs
    )

Source from the content-addressed store, hash-verified

2311 # Reductions
2312
2313 def _reduce(
2314 self, name: str, *, skipna: bool = True, keepdims: bool = False, **kwargs
2315 ):
2316 result = super()._reduce(name, skipna=skipna, keepdims=keepdims, **kwargs)
2317 if keepdims and isinstance(result, np.ndarray):
2318 if name == "std":
2319 from pandas.core.arrays import TimedeltaArray
2320
2321 return TimedeltaArray._from_sequence(result)
2322 else:
2323 return self._from_sequence(result, dtype=self.dtype)
2324 return result
2325
2326 def std(
2327 self,

Callers

nothing calls this directly

Calls 1

_from_sequenceMethod · 0.95

Tested by

no test coverage detected