Skip to content

enh: support slicing DataFrame (or Series) with Series #2383

Open
@MarcoGorelli

Description

@MarcoGorelli

The following should be supported:

import polars as pl

import pandas as pd
import narwhals as nw

df = nw.from_native(pd.DataFrame({'a':[1,2,3], 'b': [4,5,6], 'c': [0,2,1]}), eager_only=True)
print(df[df['c']])  # currently raises

Note that for Series this is already supported:

s = df['a']
s[df['c']]  # works fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions