Skip to content

all/any ignoring bool_only parameter #25101

Closed
@devin-petersohn

Description

@devin-petersohn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReshapingConcat, Merge/Join, Stack/Unstack, Explode

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions