-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
API: New callable indexing makes storing functions in a Series difficult #13299
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
Comments
this is quite odd to store callables in a Series what is the purpose of doing that? |
hmm, this is simple to fix (we just don't evaluate a callable for @sinhrks do we have a valid use of |
We're choosing a function based on some columns in a DataFrame, and then applying them on other column values / external data. Since there might be a different function for each row, it's convenient to store them in the same place. |
@evanpw I think you might be able to just remove the If you want to give this a shot and see what it looks like would be great. |
Yes, deleting this line from
|
The usage in my mind was chaining like:
I think it is more likely rather than storing callable. CC: @TomAugspurger |
I think that makes sense when calling |
yes that is a bug I think. |
Example of something that previously worked (before 7bbd031):
But now the second line tries to apply the function in the rhs to the elements of the Series, rather than assigning them (and throws an exception). This is very counter-intuitive when using
__setitem__
rather than callingSeries.where
directly.The text was updated successfully, but these errors were encountered: