-
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
isempty
checks number of columns, rather than number of rows
#1230
Comments
I think it's got to be a wholesale switch from viewing DataFrames as a columnar datastore to more of a "bag of tuples" definition (without needing to change the underlying actual representation obviously). The current view I think grew out of viewing a DataFrame as a "data-smart" Matrix (Array{T, 2}), which is column-oriented. |
I'd argue that the current behaviour is still broken even from the "data-smart" Matrix perspective though. |
Yes, what justifies the current behavior is rather the definition of |
@nalimilan I don't want to derail this issue, but when (or how often) do you want to get a column based in its integer index? I don't think I've ever wanted to do that, but that could just be my use cases. |
FWIW, I do column integer-indexing all the time, but that's because in my workflows, I code towards integer indexing instead of symbol indexing; in my mind it's faster because I can avoid the extra indirection lookup of symbol=>integer, but that extra cost is probably negligible in production. Anyway, I'd re-iterate again though that I think we need to commit to either a column-oriented or row-oriented representation, regardless of the internal implementation. Currently things are (mostly) consistent for a column-orientation, but there's obviously some desire to switch that. For example, if we switch to a row-orientation, I would definitely expect |
Either way, isn't it clearer to write |
@rofinn @ararslan I agree |
Seeing how people disagree on what's the most natural orientation, I'd rather make |
Discussion of notation aside, I think a 0-row |
I could put together a separate PR to address this in the morning, if there's interest. |
Oops, I missed your comment @spurll. |
Hey, I would have done it, but I'm chairing a board meeting right now. |
Related to #1200.
Compare:
with
It seems clear to me that a
DataFrame
with zero rows should be considered empty.FWIW, @quinnj's PR from a few days ago #1224 fixes this as well, but this particular issue seems less controversial than how we define
length
.The text was updated successfully, but these errors were encountered: