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
Seems like a bug, such a comparison should definitely be allowed. Pandas Version 0.20.2, Ubuntu.
In [2]: import pandas as pd
In [3]: df = pd.DataFrame({"a" : [1,2], "b" : [2,3]})
In [4]: import numpy as np
In [5]: np.all(df["a"] == "")
/home/alexander/anaconda3/lib/python3.5/site-packages/pandas/core/ops.py:798: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
result = getattr(x, name)(y)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-346e9f7bf435> in <module>()
----> 1 np.all(df["a"] == "")
/home/alexander/anaconda3/lib/python3.5/site-packages/pandas/core/ops.py in wrapper(self, other, axis)
859
860 with np.errstate(all='ignore'):
--> 861 res = na_op(values, other)
862 if is_scalar(res):
863 raise TypeError('Could not compare %s type with Series' %
/home/alexander/anaconda3/lib/python3.5/site-packages/pandas/core/ops.py in na_op(x, y)
798 result = getattr(x, name)(y)
799 if result is NotImplemented:
--> 800 raise TypeError("invalid type comparison")
801 except AttributeError:
802 result = op(x, y)
TypeError: invalid type comparison
The text was updated successfully, but these errors were encountered:
This is duplicate of #7830 - to be honest I don't mind us raising an exception here, although I know it conflicts with python semantics as discussed there. also xref #13129
Seems like a bug, such a comparison should definitely be allowed. Pandas Version 0.20.2, Ubuntu.
The text was updated successfully, but these errors were encountered: