-
Notifications
You must be signed in to change notification settings - Fork 368
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
Add more keyword arguments to stack
and unstack
#2422
Comments
For reference, the current docstring for
The only difference is that in Perhaps we can make |
Thank you for raising this issue! Could you please specify what would be the API you propose exactly? However, maybe you can propose a non-breaking alternative (e.g. kwargs only in some special case of positional args - and this would be non breaking then - just allowing a dual form, which is not ideal but a second best solution). But first I need to understand exactly what you propose (again - unfortunately it is crucial to be super precise here as details matter). |
The proposed API is to simply make I would also like to do something similar with
In general, the terminology doesn't match between |
There is no need to copy current docstrings I think - they are easy enough to check and easily get outdated (e.g. your docstring for I understand your proposal for stack is to have the following method signatures:
is this correct? Also then what would be your proposal for The current signatures for
and the question is what signatures you would like to have. In general it seems that we can resolve this issue in a non breaking way. |
We could also consider adding a kwarg to specify the sentinel for missing interactions (now it has to be |
#2743 is trying to address this issue, by simplifying the function signature. |
I am closing this in favor of #3237 (to have a single place to discuss all related issues) |
On Slack, I wrote that I like the new
tidyr::pivot_
functions (https://tidyr.tidyverse.org/articles/pivot.html) because the names make it really obvious what they do, and they have good arguments for indicating what goes where (names_from
,values_from
,names_to
,values_to
). In R you can always name the arguments when you call the function, so I find it easy to read a pivot command later and tell what it does.== make the relig_income table longer by taking all columns but 'religion' and stacking them, putting the column names in a new column 'income' and the values in a new column 'count'.
@pdeffebach suggested that I open an issue here to add more keyword arguments to
stack
andunstack
to make DataFrames more user-friendly in the same way.The text was updated successfully, but these errors were encountered: