Closed TariqAHassan closed 5 years ago
Thank you, and nice work!
On Mon, 17 Sep 2018 02:29 Tariq Hassan, notifications@github.com wrote:
This PR adds the ability to pass positional arguments to summarize(). This is often very handy when scripting and one just wants to quickly see the result.
Example:
from dfply import *
diamonds >> summarize(X.price.mean())
unnamed_arg_0
0 3932.799722
In dplyr, summarize() will use the code as the column name if the user does not provide one. Apart from being difficult to replicate in Python (i.e., without non-standard evaluation), it can make for quite cumbersome column names. So instead, here I generate column names which correspond to the position of the args.
I am open to any ideas you may have.
You can view, comment on, or merge this pull request online at:
https://github.com/kieferk/dfply/pull/70 Commit Summary
- Add ability to pass positional arguments to
summarize()
- Add test for positional arguments
- Merge branch 'master' of git://github.com/kieferk/dfply
- Update test name
File Changes
- M dfply/summarize.py https://github.com/kieferk/dfply/pull/70/files#diff-0 (12)
- M test/test_summarize.py https://github.com/kieferk/dfply/pull/70/files#diff-1 (22)
Patch Links:
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kieferk/dfply/pull/70, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOypIXhgncgPG97xXcZREi6ATQD4mvYks5ubvragaJpZM4WrJis .
Looks good, thanks! Merging now.
This PR adds the ability to pass positional arguments to
summarize()
. This is often very handy when scripting and one just wants to quickly see the result.Example:
In
dplyr
,summarize()
will use the code as the column name if the user does not provide one. Apart from being difficult to replicate in Python (i.e., without non-standard evaluation), it can make for quite cumbersome column names. So instead, here I generate column names which correspond to the position of theargs
.I am open to any ideas you may have.