-
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 cols to describe #2020
add cols to describe #2020
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Just to be sure, do you think this keyword argument could apply to other functions?
@@ -279,22 +281,72 @@ to each column as the only argument. For columns allowing for missing values, | |||
the vector is wrapped in a call to [`skipmissing`](@ref): custom functions must therefore | |||
support such objects (and not only vectors), and cannot access missing values. | |||
|
|||
For consistency with DataAPI.jl an `io` argument can be passed to `describe` in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we just drop this (in another PR)? Clearly if you pass io
you expect the result to be printed there, so it's actively misleading not to throw an error. Or the method taking io
should call show(io, describe(...))
.
Anyway when moving things from StatsBase to Statistics I'd like to change that API so that describe
always returns a special object that can be printed, instead of printing the result directly. That's more useful and more standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100% agreed in all you write - passing io
made no sense to me here, but it was defined in DataAPI.jl and I did not want to make breaking changes in this PR.
So - after merging this PR do we make another PR that deprecates io
? (this is what I would do in DataFrames.jl; all other actions are needed in other packages, but they can be done independently, as we clearly document how describe
with AbstractDataFrame
works).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I think we can start changing this in DataFrames, the StatsBase to Statistics move will take longer.
Co-Authored-By: Milan Bouchet-Valat <nalimilan@club.fr>
I am not fully clear what you have in mind. Do you mean that |
I guess my question was relatively broad: do we anticipate adding the |
Here we have to use For sure I would use For sure in most functions we allow If the general rule is "use positional argument if there are few of them and kwarg if there are many of them" than I would not change anything in other functions, but I am not sure if this is the rule 😢. |
@nalimilan - so do you have an opinion how we should proceed. I believe that in this PR the valid approach is to have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Maybe the main question is actually whether we should switch similar functions to a keyword argument, e.g. allowmissing
.
Fixes #2014
I have also tried to improve docs a bit.