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

Method test_datetime_maximum_reduce

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

Source from the content-addressed store, hash-verified

2463 assert_equal(np.arange(d), np.arange(np.timedelta64(0, "D"), d))
2464
2465 def test_datetime_maximum_reduce(self):
2466 a = np.array(['2010-01-02', '1999-03-14', '1833-03'], dtype='M8[D]')
2467 assert_equal(np.maximum.reduce(a).dtype, np.dtype('M8[D]'))
2468 assert_equal(np.maximum.reduce(a),
2469 np.datetime64('2010-01-02'))
2470
2471 a = np.array([1, 4, 0, 7, 2], dtype='m8[s]')
2472 assert_equal(np.maximum.reduce(a).dtype, np.dtype('m8[s]'))
2473 assert_equal(np.maximum.reduce(a),
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:

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
reduceMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected