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

Method test_datetime_maximum_reduce

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

Source from the content-addressed store, hash-verified

2022 assert_equal(np.arange(d), np.arange(0, d))
2023
2024 def test_datetime_maximum_reduce(self):
2025 a = np.array(['2010-01-02', '1999-03-14', '1833-03'], dtype='M8[D]')
2026 assert_equal(np.maximum.reduce(a).dtype, np.dtype('M8[D]'))
2027 assert_equal(np.maximum.reduce(a),
2028 np.datetime64('2010-01-02'))
2029
2030 a = np.array([1, 4, 0, 7, 2], dtype='m8[s]')
2031 assert_equal(np.maximum.reduce(a).dtype, np.dtype('m8[s]'))
2032 assert_equal(np.maximum.reduce(a),
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:

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
reduceMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected