-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bool Ops: One bug hides another #22092
Labels
Algos
Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
Bug
Dtype Conversions
Unexpected or buggy dtype conversions
Milestone
Comments
gfyoung
added
Bug
Dtype Conversions
Unexpected or buggy dtype conversions
Algos
Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
labels
Jul 30, 2018
Weird behavior = surprise features 🙂 |
3 tasks
2nd bug: Moreover, there is a bug in
This situation is alike in ^ and | operator. |
jbrockmendel
pushed a commit
that referenced
this issue
Sep 18, 2018
aeltanawy
pushed a commit
to aeltanawy/pandas
that referenced
this issue
Sep 20, 2018
…-dev#22293) * Fix bug #GH22092 * Update v0.24.0.txt * Update v0.24.0.txt * Update ops.py * Update test_operators.py * Update v0.24.0.txt * Update test_operators.py
Sup3rGeo
pushed a commit
to Sup3rGeo/pandas
that referenced
this issue
Oct 1, 2018
…-dev#22293) * Fix bug #GH22092 * Update v0.24.0.txt * Update v0.24.0.txt * Update ops.py * Update test_operators.py * Update v0.24.0.txt * Update test_operators.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Algos
Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
Bug
Dtype Conversions
Unexpected or buggy dtype conversions
Boolean ops (&, |, ^) are less well-tested than most of the others. Going through some of these, some of them raise for weird reasons:
Starting with
ser & idx
, we'd expect to getSeries([False, False, True])
. Instead we get aValueError
because we accidentally go down the path treating Index as a scalar:OK, that's fixed easily enough. What about the reversed operation
idx & ser
? That means something entirely different, sinceIndex.__and__
is an alias forIndex.intersection
, so we'd expect either aSeries
orIndex
containing bothFalse
andTrue
. Instead we get aValueError
:The comparison
dtype in [object, np.object_, 'object', 'O']
raises whendtype
is array-like. If we change that condition tois_hashable(dtype) and dtype in [object, np.object_, 'object', 'O']
, we getIndex([False, True, True])
, which is what we expected from theSeries
op, but not from theIndex
op.The text was updated successfully, but these errors were encountered: