-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG/QST: Series.transform with a dictionary #35811
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
I find this is a bug actually, the docs for
And I get this:
|
@onshek - yes, agreed. The question then is, what should be the output? A dataframe with columns being the keys of the dictionary seems reasonable to me, but I can't find any documentation saying/showing this. I think that fits in well with |
@rhshadrach I think the main point is
And
|
What is the expected output of passing a dictionary to
Series.transform
? For example:The docs say that
dict of axis labels -> functions
is acceptable, but I can't find any example in the docs where the output is described/shown. Under the hood,Series.transform
is just callingSeries.aggregate
which produces the following outputs forresult1
andresult2
.result1
is deemed acceptable (the length of the result equals the length of the input) and is returned, butresult2
raises; it is not a transformation.I am wondering if a better return would be a DataFrame where the keys are the column names ('a' and 'b' in this example).
The text was updated successfully, but these errors were encountered: