-
Notifications
You must be signed in to change notification settings - Fork 21
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
rev on DataFrame does not reverse column order, as it does on data.frame #68
Comments
Yes, a consequence of underlying implementation. More precisely, it's a consequence of the 2 things though:
|
For me, most important is having a correct mental model so I don't make invalid assumptions. Possibly improving documentation somehow would serve, but I'm unsure how best to teach/explain where the analogy to data.frame should not be expected to hold. |
IMO the current system provides intuitive and useful behavior for In terms of documentation, I wonder whether this row-based interpretation of a |
I generally agree with your intuitions and even recall in the past being surprised by some of the behavior of data.frame. But I got used to it... The DataFrame documentation begins:
Perhaps a section detailing other (perhaps less notable) exceptions might be in order, along the lines of:
However, reviewing
... but length(DF) tells me the number of columns in the DataFrame and rev(DF) reverses the rows of the DF. The point is that referring to the documentation of the underlying implementation does not fully clarify, at least for me, what I might expect the behavior of Am I missing some clarifying principle? |
Perhaps I should infer this from the documentation.
Or it is natural consequence from underlying implementation.
Or perhaps it is an unintentional behavior.
Can I get a witness?
Is there a contract? Might this change?
Thanks!
The text was updated successfully, but these errors were encountered: