We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35821a5 commit 73ee7e1Copy full SHA for 73ee7e1
pandas/core/indexes/base.py
@@ -112,17 +112,11 @@ def cmp_method(self, other):
112
with np.errstate(all="ignore"):
113
result = op(self.values, np.asarray(other))
114
115
- # technically we could support bool dtyped Index
116
- # for now just return the indexing array directly
117
if is_bool_dtype(result):
118
return result
119
- try:
120
- return Index(result)
121
- except TypeError:
122
- return result
+ return ops.invalid_comparison(self, other, op)
123
124
name = "__{name}__".format(name=op.__name__)
125
- # TODO: docstring?
126
return set_function_name(cmp_method, name, cls)
127
128
0 commit comments