-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
Filterse.g. head, tail, nthe.g. head, tail, nthNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action
Description
I think it'd be very nice for users to get this working regarding filter:
df.filter(df["age"] > 18) # same as `df[df["age"] > 18`
df.filter("age > 18") # same as `df.query("age > 18")`, I think `.query` should be deprecated if this is implemented in `.filter`
df.filter(lambda df: df["age"] > 18) # same as `df[df['age'].apply(lambda x: x > 18)]`, useful for method chaining
I think implementing this is reasonably simple. I think the main challenge is how to design the API in a way that filter can be intuitive and still work with the current parameters. And particularly, keeping backward compatibility. But personally, I think this would be so useful, that worth finding a solution.
CC: @rhshadrach
Metadata
Metadata
Assignees
Labels
Filterse.g. head, tail, nthe.g. head, tail, nthNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action