-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
pd.eval
: Series
names are now preserved even for "numexpr"
engine.
#58437
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
Conversation
Series names are now preserved even when using numexpr engine. Making the behavior consistent with python engine.
return typ(obj, dtype=res_t, **axes) | ||
return typ(obj, dtype=res_t, name=name, **axes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't name=None
also be OK? i.e. Can't this always be return typ(obj, dtype=res_t, name=name, **axes)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately no. In some cases typ
is DataFrame
(in particular cases like pd.eval("df + df")
) in which case passing anything as name=
(including None
) would raise a TypeError
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
Thanks @domsmrz |
…ne. (pandas-dev#58437) * Eval: Series names are preserved for numexpr Series names are now preserved even when using numexpr engine. Making the behavior consistent with python engine. * Update doc/source/whatsnew/v3.0.0.rst Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> * Update pandas/core/computation/align.py Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> * Update pandas/tests/computation/test_eval.py --------- Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
Series names are now preserved even when using
numexpr engine. Making the behavior consistent
with python engine.
DataFrame.eval
#58069)doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.