Skip to content

Commit fd402d3

Browse files
jbrockmendelcbpygit
authored andcommitted
PERF: resolution, is_normalized (pandas-dev#56637)
PERF: resolution
1 parent 8e5b749 commit fd402d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/_libs/tslibs/vectorized.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def get_resolution(
234234

235235
for i in range(n):
236236
# Analogous to: utc_val = stamps[i]
237-
utc_val = cnp.PyArray_GETITEM(stamps, cnp.PyArray_ITER_DATA(it))
237+
utc_val = (<int64_t*>cnp.PyArray_ITER_DATA(it))[0]
238238

239239
if utc_val == NPY_NAT:
240240
pass
@@ -331,7 +331,7 @@ def is_date_array_normalized(ndarray stamps, tzinfo tz, NPY_DATETIMEUNIT reso) -
331331

332332
for i in range(n):
333333
# Analogous to: utc_val = stamps[i]
334-
utc_val = cnp.PyArray_GETITEM(stamps, cnp.PyArray_ITER_DATA(it))
334+
utc_val = (<int64_t*>cnp.PyArray_ITER_DATA(it))[0]
335335

336336
local_val = info.utc_val_to_local_val(utc_val, &pos)
337337

0 commit comments

Comments
 (0)