-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
doc: DataFrame.apply can return several columns #5299
Comments
If you wanted to operate rows wise, you could also select two columns firsf ( If you want to create a new DataFrame of a different size, you can use zip or izip in a list comprehension to the DataFrame constructor. DataFrame([my_apply_func(a, b) for a, b in zip(df[a], df[b])], columns=['a', 'b', 'c']) |
And I guess the title of this changed since I posted this... Whoops. |
@ohadle this has been in the docs for a while: http://pandas.pydata.org/pandas-docs/dev/groupby.html#flexible-apply |
Sorry, I kept looking over here |
you mean a reference to the apply section...sure that would be nice, Pull-Request? |
This is now in the docstring of apply: http://pandas-docs.github.io/pandas-docs-travis/generated/pandas.DataFrame.apply.html |
Might be worth mentioning in the docs that if "func" returns a Series, the result is a DataFrame.
It took me a while to figure this out (tried with tuples and a dict).
The text was updated successfully, but these errors were encountered: