Skip to content

Commit 597238d

Browse files
author
MarcoGorelli
committed
do we need tzoffset?
1 parent f84f594 commit 597238d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pandas/_libs/tslib.pyx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -723,20 +723,15 @@ cpdef array_to_datetime(
723723
if not is_same_offsets:
724724
_result = np.empty(n, dtype="object")
725725
for i in range(n):
726-
if checknull_with_nat_and_na(iresult[i]):
727-
# GH 25978. No need to parse NaT-like or datetime-like vals
728-
_result[i] = NPY_NAT
726+
if iresult[i] != iresult[i] or iresult[i] == NPY_NAT:
727+
_result[i] = result[i]
729728
continue
730729
_dt = dt.datetime.utcfromtimestamp(iresult[i]/1_000_000_000)
731730
if result_timezone[i] is not None:
732731
_tzinfo = pytz.FixedOffset(result_timezone[i]/60)
733732
_result[i] = _dt.replace(tzinfo=pytz.UTC).astimezone(_tzinfo)
734733
else:
735734
_result[i] = _dt
736-
print("_dt", _dt)
737-
print("resultimteinzei", result_timezone[i])
738-
print("iresulti", iresult[i])
739-
print("resulti", result[i])
740735
return _result, None
741736
else:
742737
tz_offset = out_tzoffset_vals.pop()

0 commit comments

Comments
 (0)