Skip to content

Commit 0664bd3

Browse files
committed
fix condition
1 parent c48de7e commit 0664bd3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,10 @@ def array_to_timedelta64(
449449
ival = parse_iso_format_string(item)
450450
else:
451451
ival = parse_timedelta_string(item)
452-
if infer_reso and not needs_nano_unit(ival, item):
452+
if (
453+
(infer_reso or creso == NPY_DATETIMEUNIT.NPY_FR_us)
454+
and not needs_nano_unit(ival, item)
455+
):
453456
item_reso = NPY_DATETIMEUNIT.NPY_FR_us
454457
ival = ival // 1000
455458
else:

0 commit comments

Comments
 (0)