Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ac27ac

Browse files
committed
TST: test list datetime64 converts
1 parent 3b0d3e1 commit 8ac27ac

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/tests/test_dates.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,3 +641,9 @@ def test_tz_utc():
641641
def test_num2timedelta(x, tdelta):
642642
dt = mdates.num2timedelta(x)
643643
assert dt == tdelta
644+
645+
646+
def test_datetime64_in_list():
647+
dt = [np.datetime64('2000-01-01'), np.datetime64('2001-01-01')]
648+
dn = mdates.date2num(dt)
649+
assert np.array_equal(dn, [730120., 730486.])

0 commit comments

Comments
 (0)