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

pandas.DataFrame.eval("x/y") fails when x & y are unumpy.uarray's #151

Open
rajarshi opened this issue Mar 20, 2022 · 0 comments
Open

pandas.DataFrame.eval("x/y") fails when x & y are unumpy.uarray's #151

rajarshi opened this issue Mar 20, 2022 · 0 comments

Comments

@rajarshi
Copy link

When executing the following code, Pandas reports that TypeError: unsupported operand type(s) for /: 'object' and 'object'

    from uncertainties import unumpy
    df = pd.DataFrame(unumpy.uarray([[1, 2], [5, 6]],
                                    [[0.1, 0.2], [0.5, 0.1]]),
                      columns=['x', 'y'])
    print(df.eval("x / y", inplace=False))

However, if the formula is x+y or x*y or even x**y it works fine.

Not sure if this an issue for uncertainties or an issue in Pandas, but I'm surprised that this only happens for division

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant