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

BUG: Reduction operations fail #41074

Closed
2 of 3 tasks
YarShev opened this issue Apr 21, 2021 · 3 comments · Fixed by #41711
Closed
2 of 3 tasks

BUG: Reduction operations fail #41074

YarShev opened this issue Apr 21, 2021 · 3 comments · Fixed by #41711
Assignees
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations Regression Functionality that used to work in a prior pandas version
Milestone

Comments

@YarShev
Copy link
Contributor

YarShev commented Apr 21, 2021

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Code Sample, a copy-pastable example

import pandas
pdf = pandas.DataFrame([1, 'a', True])

# behavior for pandas 1.2.3
pdf.prod(axis=0, min_count=1, numeric_only=False)
0    a
dtype: object

# behavior for pandas 1.2.4
pdf.prod(axis=0, min_count=1, numeric_only=False)
AssertionError: assert numeric_only is None

# behavior for pandas 1.2.3
pdf.sum(axis=0, min_count=1, numeric_only=False)
TypeError: unsupported operand type(s) for  : 'int' and 'str'

# behavior for pandas 1.2.4
pdf.sum(axis=0, min_count=1, numeric_only=False)
AssertionError: assert numeric_only is None

Problem description

Some of the reduction operations (namely, sum and prod) has changed own behavior in 1.2.4 comparing to 1.2.3. prod has become failing and sum has thrown another exception. Other reduction operations need to be checked as well.

Output of pd.show_versions()

pandas : 1.2.4
numpy : 1.19.5
pytz : 2021.1
dateutil : 2.8.1
pip : 20.2.4
setuptools : 50.3.1.post20201107
Cython : None
pytest : 6.2.2
hypothesis : None
sphinx : 3.5.1
blosc : None
feather : 0.4.1
xlsxwriter : None
lxml.etree : 4.6.2
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.3
IPython : 7.20.0
pandas_datareader: None
bs4 : 4.9.3
bottleneck : None
fsspec : 0.8.5
fastparquet : None
gcsfs : None
matplotlib : 3.2.2
numexpr : 2.7.2
odfpy : None
openpyxl : 3.0.6
pandas_gbq : 0.14.1
pyarrow : 1.0.0
pyxlsb : None
s3fs : None
scipy : 1.6.0
sqlalchemy : 1.3.23
tables : 3.6.1
tabulate : None
xarray : 0.16.2
xlrd : 2.0.1
xlwt : None
numba : None

@YarShev YarShev added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 21, 2021
@rhshadrach
Copy link
Member

Thanks for the report! Looks to me like this was due to #40143, cc @simonjayhawkins

@rhshadrach rhshadrach added Numeric Operations Arithmetic, Comparison, and Logical operations Regression Functionality that used to work in a prior pandas version and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 23, 2021
@rhshadrach rhshadrach added this to the 1.2.5 milestone Apr 23, 2021
@simonjayhawkins simonjayhawkins self-assigned this Apr 23, 2021
@simonjayhawkins
Copy link
Member

Some of the reduction operations (namely, sum and prod) has changed own behavior in 1.2.4 comparing to 1.2.3. prod has become failing and sum has thrown another exception. Other reduction operations need to be checked as well.

AFAICT only sum and prod (on the Dataframe methods) support the min_count parameter

@YarShev
Copy link
Contributor Author

YarShev commented May 31, 2021

@simonjayhawkins , probably, that is true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations Regression Functionality that used to work in a prior pandas version
Projects
None yet
3 participants