Skip to content

truediv argument of pandas.eval ignored. #28446

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

Closed
simonjayhawkins opened this issue Sep 14, 2019 · 5 comments
Closed

truediv argument of pandas.eval ignored. #28446

simonjayhawkins opened this issue Sep 14, 2019 · 5 comments
Labels
Clean Docs expressions pd.eval, query Numeric Operations Arithmetic, Comparison, and Logical operations

Comments

@simonjayhawkins
Copy link
Member

Code Sample, a copy-pastable example if possible

>>> import pandas as pd
>>>
>>> pd.__version__
'0.25.0+350.g330bedeb7'
>>>
>>> df = pd.DataFrame({'A': range(1, 6)})
>>>
>>> df.eval('A/2')
0    0.5
1    1.0
2    1.5
3    2.0
4    2.5
dtype: float64
>>>
>>> df.eval('A/2', truediv = False)
0    0.5
1    1.0
2    1.5
3    2.0
4    2.5
dtype: float64
>>>
>>> df.eval('A/2', truediv = True)
0    0.5
1    1.0
2    1.5
3    2.0
4    2.5
dtype: float64

Problem description

The docs state..

truediv : bool, optional
    Whether to use true division, like in Python >= 3

but the truediv argument is ignored.

@simonjayhawkins simonjayhawkins added Numeric Operations Arithmetic, Comparison, and Logical operations 2/3 Compat Clean Docs labels Sep 14, 2019
simonjayhawkins added a commit to simonjayhawkins/pandas that referenced this issue Sep 14, 2019
@jbrockmendel
Copy link
Member

I'm pretty sure this is a holdover from py2

@simonjayhawkins
Copy link
Member Author

i think so too. so just need to clean and add test?

possible solution simonjayhawkins@3dd747c

but would that be a breaking api change?

@jbrockmendel
Copy link
Member

that looks like a good fix, yes. i think it technically would be a breaking change, yes

@simonjayhawkins
Copy link
Member Author

so the earliest we can introduce the deprecation is 1.0.0 and the earliest we apply the fix is 2.0.0!

@jbrockmendel jbrockmendel added the expressions pd.eval, query label Oct 22, 2019
@jbrockmendel
Copy link
Member

Closed by #29812.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Docs expressions pd.eval, query Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

No branches or pull requests

2 participants