Skip to content
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

all/any ignoring bool_only parameter #25101

Closed
devin-petersohn opened this issue Feb 3, 2019 · 1 comment · Fixed by #25102
Closed

all/any ignoring bool_only parameter #25101

devin-petersohn opened this issue Feb 3, 2019 · 1 comment · Fixed by #25102
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Milestone

Comments

@devin-petersohn
Copy link
Contributor

devin-petersohn commented Feb 3, 2019

Code Sample, a copy-pastable example if possible

# Your code here
import pandas as pd
print(pd.DataFrame({"col1": [1,2,3], "col2": [4,5,6], "col3": [None, None, None]}).all(bool_only=True))
print(pd.DataFrame({"col1": [1,2,3], "col2": [4,5,6], "col3": [None, None, None], "col4":[False, False, True]}).all(bool_only=True))

Problem description

DataFrame.all and DataFrame.any are both ignoring bool_only parameter. It does not seem to matter if there are booleans in the input or not.

This was a regression in 0.24.0. On 0.23.4 it was working, expected output from code sample below.

Expected Output

Expected output is:

Series([], dtype: bool)

col4    False
dtype: bool

Output of pd.show_versions()

[paste the output of pd.show_versions() here below this line]

INSTALLED VERSIONS
------------------
commit: None
python: 3.6.6.final.0
python-bits: 64
OS: Darwin
OS-release: 16.7.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.24.0
pytest: 3.8.2
pip: 18.0
setuptools: 40.4.3
Cython: 0.29
numpy: 1.15.0
scipy: 1.2.0
pyarrow: 0.12.0-RAY
xarray: None
IPython: 7.0.1
sphinx: 1.8.1
patsy: None
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: 0.4.0
matplotlib: 3.0.0
openpyxl: 2.5.8
xlrd: 1.1.0
xlwt: None
xlsxwriter: None
lxml.etree: 4.2.5
bs4: None
html5lib: None
sqlalchemy: 1.2.17
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: 0.6.1
pandas_datareader: None
gcsfs: None
@devin-petersohn
Copy link
Contributor Author

It appears to be due to this PR: #24434, where the filter for boolean data was removed from the _reduce method to fix a bug for axis=1. I created #25102 to solve (both) problems.

@jreback jreback added this to the 0.24.2 milestone Feb 3, 2019
@jreback jreback added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Feb 3, 2019
devin-petersohn added a commit to devin-petersohn/modin that referenced this issue Feb 20, 2019
* pandas release notes: http://pandas.pydata.org/pandas-docs/stable/whatsnew/v0.24.0.html
* Update imports to match changes in pandas
* Add functionality for list of functions on `axis=1` for `apply`
* Remove `pd.match` from API
* Small regression in pandas requires regression in Modin
  * pandas-dev/pandas#25101 reports this issue
  * pandas-dev/pandas#25102 resolves this issue
* TODO: Expose `pandas.Array` once we properly test
devin-petersohn added a commit to modin-project/modin that referenced this issue Feb 21, 2019
* Update pandas version to 0.24

* pandas release notes: http://pandas.pydata.org/pandas-docs/stable/whatsnew/v0.24.0.html
* Update imports to match changes in pandas
* Add functionality for list of functions on `axis=1` for `apply`
* Remove `pd.match` from API
* Small regression in pandas requires regression in Modin
  * pandas-dev/pandas#25101 reports this issue
  * pandas-dev/pandas#25102 resolves this issue
* TODO: Expose `pandas.Array` once we properly test

* Finishing regression update in `all`/`any`

* Update to pandas 0.24 in setup.py and requirements.txt

* Bump to 0.24.1

* Update API and add a test for the API

* Add test for API, update API

* Update API test and finalize compatibility updates

* Revert bug

* Cleanup and add tests

* Fix bug in test

* Lint

* Lint

* Remove print

* Fix transform tests and bug in transform

* Add list test for test_rename

* Fix transform bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants