MCPcopy Create free account
hub / github.com/numpy/numpy / test_timedelta_correct_mean

Method test_timedelta_correct_mean

numpy/core/tests/test_datetime.py:2035–2039  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2033 np.timedelta64(7, 's'))
2034
2035 def test_timedelta_correct_mean(self):
2036 # test mainly because it worked only via a bug in that allowed:
2037 # `timedelta.sum(dtype="f8")` to ignore the dtype request.
2038 a = np.arange(1000, dtype="m8[s]")
2039 assert_array_equal(a.mean(), a.sum() / len(a))
2040
2041 def test_datetime_no_subtract_reducelike(self):
2042 # 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