-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
API: chained reshaping ops #11485
Comments
cc @jorisvandenbossche @TomAugspurger @sinhrks @shoyer FYI @TomAugspurger I really do like comes from this example
|
forgot about
|
Yes, |
yeh, then of course
for consistency ok, then it allows easy chaining based on values, which is nice to do (and then is consistent with how |
Yep, putting support for functions in indexing makes sense to me. |
Would be nice if this also worked on And +1 for @shoyer's suggestion re extending query for this: |
@MaximilianR I'm using your example from #12226:
|
@kawochen Ah - that's very nice. Not sure how I missed that. Thanks! |
accept callables
(not changed, see ENH: Allow where/mask/Indexers to accept callable #12539).query
.where/.mask
(ENH: Allow where/mask/Indexers to accept callable #12539).loc
(and indexers) (ENH: Allow where/mask/Indexers to accept callable #12539)an operation that changes the shape of the DataFrame
can be done like this
SQL calls this
select
, which pandas has, but bothselect/filter
are used for filtering LABELS (and not data).I suppose making this work:
df.dropna().loc[lambda x: x[x.B=='a']]
is maybe a slight enhancement of thisany thoughts?
The text was updated successfully, but these errors were encountered: