-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: improve conversion to BooleanArray from int/float array #30095
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
PERF: improve conversion to BooleanArray from int/float array #30095
Conversation
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 this issue number onto the list for adding boolean array in the whatsnew.
can you add some tests specifically for this (we might have them, but pls point them out)
Related Test: pandas/pandas/tests/arrays/test_boolean.py Lines 136 to 155 in 2d5455c
pandas/pandas/tests/arrays/test_boolean.py Line 108 in 2d5455c
|
ok lgtm. can you do a simple benchmark on this and show it (+1 if you can add it to the asvs) |
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.
lgtm as well outside of @jreback comments
I used pytest-benchmark to do the simple benchmarking, as I'm not quite sure where should I write the benchmark for the boolean array in the asv folder. Original Branch:
PR Branch:
Is it now okay to merge? @jreback |
@ethanywang see the asv docs here: https://dev.pandas.io/docs/development/contributing.html#running-the-performance-test-suite can you construct some asvs which add some benchmarks (and then show the results here) you can create a new file in benchmarks/ call it array.py (and then use pd.array for the construction). |
@jreback Using the asv bechmark. The results are:
|
perfect @ethanywang would a follow up PR for similar asvs for IntegerArray and StringArray (we might have some in series somewhere for IntegerArray already) |
@jreback So you mean I can remove the array.py in the asv_benchmark folder, and not submit it in this PR? |
no in a follow up PR i would like to add asv constructions for IntegerArray and StringArray in array.py we may have some construction benchmarks already for Integer dtypes in Series which we can move |
@ethanywang Thanks a lot! |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff