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: Series.__mod__ behaves different with >1e4 rows #36047

Closed
1 task
river-00 opened this issue Sep 1, 2020 · 2 comments · Fixed by #36552
Closed
1 task

BUG: Series.__mod__ behaves different with >1e4 rows #36047

river-00 opened this issue Sep 1, 2020 · 2 comments · Fixed by #36552
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations Regression Functionality that used to work in a prior pandas version
Milestone

Comments

@river-00
Copy link

river-00 commented Sep 1, 2020

  • [√] 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

# Your code here
import pandas as pd
ts = pd.Series([-2,-2,-2])
ts = pd.concat(5000 * [ts])
(ts[:10001]%4).iloc[-1]
(ts[:10000]%4).iloc[-1]

Gives
-2
2

Problem description

According to basic python module operations and previous versions of pandas, the module operation should always give a non-negative value, but when a Series larger than 10000 rows, the negative value module array operation gives a negative value.

Expected Output

2
2

Output of pd.show_versions()

1.1.1

@river-00 river-00 added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 1, 2020
@jbrockmendel
Copy link
Member

series over 1e4 rows use numexpr, see core.computation.expressions._MIN_ELEMENTS. more investigation welcome

@jbrockmendel jbrockmendel added Numeric Operations Arithmetic, Comparison, and Logical operations and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 1, 2020
@jbrockmendel jbrockmendel changed the title BUG: Module operation gives negative value with Series of more than 10000 rows BUG: Series.__mod__ behaves different with >1e4 rows Sep 1, 2020
@asishm
Copy link
Contributor

asishm commented Sep 2, 2020

On 1.0.5 it outputs 2 regardless of whether numexpr is installed. On 1.1.1, with numexpr installed it returns -2 as shown (with the limit). Not sure if it would class as a regression

01623f8 is the first bad commit
commit 01623f8
Author: Martin Winkel martin.winkel.pps@gmail.com
Date: Sat Feb 1 16:13:05 2020 +0100

CLN: Refactor pandas/tests/base - part3 (#30147)

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
Development

Successfully merging a pull request may close this issue.

4 participants