Skip to content
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

sub df by row or column #1313

Closed
Wikunia opened this issue Dec 11, 2017 · 1 comment
Closed

sub df by row or column #1313

Wikunia opened this issue Dec 11, 2017 · 1 comment

Comments

@Wikunia
Copy link

Wikunia commented Dec 11, 2017

I know dataframes is more column focused...
If I have a dataframe df
and then use

df[[1,2,3],:]

it return the first three rows.

If I do:

df[[1,2,3]]

I get the first three columns. This is a bit confusing to me.
If it is more column focused shouldn't it be

df[:,[1,2,3]]

in the first place? I know that would be breaking.

The other variant would be:

df[[1,2,3]]

get the first three rows and

df[[:bla,:blub,:last]]

might return those columns. If I mention an integer it is most of the time the row and not the column which can be retrieved by name.

@ararslan
Copy link
Member

The problem here is that using a single index into a DataFrame retrieves columns by index rather than rows, which several folks in #1200 have noted is rather odd. I'm going to close this and further discussion can happen in #1200 should there be anything else to add. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants