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

feat: allow for multiindex columns to be selected using nw.col #1050

Open
MarcoGorelli opened this issue Sep 23, 2024 · 0 comments
Open

feat: allow for multiindex columns to be selected using nw.col #1050

MarcoGorelli opened this issue Sep 23, 2024 · 0 comments

Comments

@MarcoGorelli
Copy link
Member

MarcoGorelli commented Sep 23, 2024

I don't have time for a complete write-up right now, but basically, this: https://discord.com/channels/1235257048170762310/1235257049626181656/1287833882216894506

EDIT looks like we already support this:

In [22]: nw.from_native(df_mi).select(nw.col([(1, 4)])*2).to_native()
Out[22]:
    1
    4
c  14

In [23]: df_mi
Out[23]:
a  1  2  3
b  4  5  6
c  7  8  9

I'll add a note about this in the "pandas quirks" section fo the docs, but strongly recommend that library authors take the decision to only allow unique string names 😅 but if they really want multi-index column support, we at least offer them a way to do that, even if it's a little inconvenient

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

1 participant