Skip to content

Commit f04849a

Browse files
committed
FIX: make timezone conversion one loop instead of two
1 parent d4e5ddc commit f04849a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/dates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ def date2num(d):
425425
tzi = getattr(d[0], 'tzinfo', None)
426426
if tzi is not None:
427427
# make datetime naive:
428-
d = [dt.astimezone(UTC) for dt in d]
429-
d = np.asarray([dt.replace(tzinfo=None) for dt in d])
428+
d = [dt.astimezone(UTC).replace(tzinfo=None) for dt in d]
429+
d = np.asarray(d)
430430
d = d.astype('datetime64[us]')
431431

432432
d = _dt64_to_ordinalf(d)

0 commit comments

Comments
 (0)