You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
numpy/numpy#16273 (comment) broke the case of NumPy's percentile with bools which causes to break pandas pandas' quantile too. If this is considered as not a bug, I would expect pandas to handle it with numeric_only. Cross filed issue in NumPy: numpy/numpy#19154
Currently it throws an exception as below:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/.../python3.8/site-packages/pandas/core/frame.py", line 9266, in quantile
result = data._mgr.quantile(
File "/.../python3.8/site-packages/pandas/core/internals/managers.py", line 491, in quantile
block = b.quantile(axis=axis, qs=qs, interpolation=interpolation)
File "/.../python3.8/site-packages/pandas/core/internals/blocks.py", line 1592, in quantile
result = nanpercentile(
File "/.../python3.8/site-packages/pandas/core/nanops.py", line 1675, in nanpercentile
return np.percentile(values, q, axis=axis, interpolation=interpolation)
File "<__array_function__ internals>", line 5, in percentile
File "/.../python3.8/site-packages/numpy/lib/function_base.py", line 3818, in percentile
return _quantile_unchecked(
File "/.../python3.8/site-packages/numpy/lib/function_base.py", line 3937, in _quantile_unchecked
r, k = _ureduce(a, func=_quantile_ureduce_func, q=q, axis=axis, out=out,
File "/.../python3.8/site-packages/numpy/lib/function_base.py", line 3515, in _ureduce
r = func(a, **kwargs)
File "/.../python3.8/site-packages/numpy/lib/function_base.py", line 4064, in _quantile_ureduce_func
r = _lerp(x_below, x_above, weights_above, out=out)
File "/.../python3.8/site-packages/numpy/lib/function_base.py", line 3961, in _lerp
diff_b_a = subtract(b, a)
TypeError: numpy boolean subtract, the `-` operator, is not supported, use the bitwise_xor, the `^` operator, or the logical_xor function instead.
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Problem description
numpy/numpy#16273 (comment) broke the case of NumPy's
percentile
with bools which causes to break pandas pandas'quantile
too. If this is considered as not a bug, I would expect pandas to handle it withnumeric_only
. Cross filed issue in NumPy: numpy/numpy#19154Currently it throws an exception as below:
Expected Output
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: