Query on Series #12226
Labels
API Design
Indexing
Related to indexing on series/frames, not to indexes themselves
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
I often find myself building a chain of logic, and then wanting to slice over some expression. Here's a contrived example:
...and then having to assign to a separate variable and slice using that. Which is not the worst affliction that could strike western civilization, but can disrupt the flow in a repl a little.
Instead, would it be reasonable to extend query or filter to do this. For example:
pd.Series(range(10)).mul(5).pipe(lambda x: x**2).pipe(lambda x: x-500).query('>200')
or
pd.Series(range(10)).mul(5).pipe(lambda x: x**2).pipe(lambda x: x-500).filter(lambda x: x>200)
The text was updated successfully, but these errors were encountered: