-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BugFrequencyDateOffsetsDateOffsetsNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations
Milestone
Description
When surpassing the minimum number of elements threshold to use numexpr, the following operation starts to fail:
In [19]: td = pd.offsets.Day(3)
In [20]: td / pd.Series([1, 2]*5000)
Out[20]:
0 3 days 00:00:00
1 1 days 12:00:00
...
9998 3 days 00:00:00
9999 1 days 12:00:00
Length: 10000, dtype: timedelta64[ns]
In [21]: td / pd.Series([1, 2]*5001)
...
~/miniconda3/envs/dev/lib/python3.7/site-packages/numexpr/necompiler.py in getType(a)
701 if kind == 'S':
702 return bytes
--> 703 raise ValueError("unknown type %s" % a.dtype.name)
704
705
ValueError: unknown type object
This doesn't happen for a Timedelta object, I assume because of this check:
pandas/pandas/core/ops/array_ops.py
Lines 202 to 203 in 7af47c9
if should_extension_dispatch(lvalues, rvalues) or isinstance(rvalues, Timedelta): | |
# Timedelta is included because numexpr will fail on it, see GH#31457 |
Metadata
Metadata
Assignees
Labels
BugFrequencyDateOffsetsDateOffsetsNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations