Open jorisvandenbossche opened 2 weeks ago
but currently fails with the pyarrow-backed string dtype:
also fails with the numpy backed string dtype:
>>> ser2 = pd.Series(["", "b"], dtype="string[python]")
>>> ser2
0
1 b
dtype: string
>>>
>>> ser2.dtype.storage
'python'
>>>
>>> ser1 | ser2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/simon/pandas/pandas/core/ops/common.py", line 76, in new_method
return method(self, other)
File "/home/simon/pandas/pandas/core/arraylike.py", line 79, in __or__
return self._logical_method(other, operator.or_)
File "/home/simon/pandas/pandas/core/series.py", line 5881, in _logical_method
res_values = ops.logical_op(lvalues, rvalues, op)
File "/home/simon/pandas/pandas/core/ops/array_ops.py", line 439, in logical_op
res_values = op(lvalues, rvalues)
File "/home/simon/pandas/pandas/core/arrays/numpy_.py", line 193, in __array_ufunc__
result = getattr(ufunc, method)(*inputs, **kwargs)
TypeError: unsupported operand type(s) for |: 'bool' and 'str'
>>>
take
Hi @jorisvandenbossche, the bot doesn't seem to be working for me, would it possible for you to manually assign this issue to me?
It seems to have worked now
We do allow using logical operators like
|
to be used with non-boolean data (at which point the non-bool series would be cast to bool, I assume). For example:This also worked with strings in object dtype:
but currently fails with the pyarrow-backed string dtype: