-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: Fixes performance regression in DataFrame[bool_indexer] (#33924) #34199
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
Conversation
Hello @mproszewska! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-05-31 23:38:07 UTC |
pandas/core/indexing.py
Outdated
result = np.asarray(result, dtype=bool) | ||
result = check_array_indexer(index, result) | ||
else: | ||
if not is_array_like(result): | ||
# GH 33924 | ||
result = pd_array(result, dtype=bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just np.array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because of nullable input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the input is nullable, wouldn't not is_array_like(result)
be False
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that this array/list can have nullable elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add an asv that hits this case & a whatsnew note
|
can you run and post the indexing the asvs |
|
I could change size of tested DataFrame, so that benchmarks would change more significantly. |
sure as long as benchamarks are << 1s its ok (e.g. in ms). please post the actual asv run. otherwise looks fine. ping on green. |
After asv change
|
lgtm ping on green |
ping |
thanks @mproszewska |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Insted of calling
construction.array
incheck_array_indexer
, creates array withdtype=bool
before callingcheck_array_indexer
.Fixes performance regression after commit b9bcdc3.