Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/tslibs/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class TimeGetTimedeltaField:
params = [
_sizes,
["days", "h", "s", "seconds", "ms", "microseconds", "us", "ns", "nanoseconds"],
["days", "seconds", "microseconds", "nanoseconds"],
]
param_names = ["size", "field"]

Expand Down
55 changes: 0 additions & 55 deletions pandas/_libs/tslibs/fields.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -487,28 +487,6 @@ def get_timedelta_field(const int64_t[:] tdindex, str field):
out[i] = tds.days
return out

elif field == 'h':
with nogil:
for i in range(count):
if tdindex[i] == NPY_NAT:
out[i] = -1
continue

td64_to_tdstruct(tdindex[i], &tds)
out[i] = tds.hrs
return out

elif field == 's':
with nogil:
for i in range(count):
if tdindex[i] == NPY_NAT:
out[i] = -1
continue

td64_to_tdstruct(tdindex[i], &tds)
out[i] = tds.sec
return out

elif field == 'seconds':
with nogil:
for i in range(count):
Expand All @@ -520,17 +498,6 @@ def get_timedelta_field(const int64_t[:] tdindex, str field):
out[i] = tds.seconds
return out

elif field == 'ms':
with nogil:
for i in range(count):
if tdindex[i] == NPY_NAT:
out[i] = -1
continue

td64_to_tdstruct(tdindex[i], &tds)
out[i] = tds.ms
return out

elif field == 'microseconds':
with nogil:
for i in range(count):
Expand All @@ -542,28 +509,6 @@ def get_timedelta_field(const int64_t[:] tdindex, str field):
out[i] = tds.microseconds
return out

elif field == 'us':
with nogil:
for i in range(count):
if tdindex[i] == NPY_NAT:
out[i] = -1
continue

td64_to_tdstruct(tdindex[i], &tds)
out[i] = tds.us
return out

elif field == 'ns':
with nogil:
for i in range(count):
if tdindex[i] == NPY_NAT:
out[i] = -1
continue

td64_to_tdstruct(tdindex[i], &tds)
out[i] = tds.ns
return out

elif field == 'nanoseconds':
with nogil:
for i in range(count):
Expand Down