MCPcopy Index your code
hub / github.com/numpy/numpy / test_timedelta_correct_mean

Method test_timedelta_correct_mean

numpy/_core/tests/test_datetime.py:2476–2480  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2474 np.timedelta64(7, 's'))
2475
2476 def test_timedelta_correct_mean(self):
2477 # test mainly because it worked only via a bug in that allowed:
2478 # `timedelta.sum(dtype="f8")` to ignore the dtype request.
2479 a = np.arange(1000, dtype="m8[s]")
2480 assert_array_equal(a.mean(), a.sum() / len(a))
2481
2482 def test_datetime_no_subtract_reducelike(self):
2483 # subtracting two datetime64 works, but we cannot reduce it, since

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
meanMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected