Is there a query method or similar for pandas Series (pandas.Series.query())?

后端 未结 3 754
终归单人心
终归单人心 2021-02-18 20:02

The pandas.DataFrame.query() method is of great usage for (pre/post)-filtering data when loading or plotting. It comes particularly handy for method chaining.

<
3条回答
  •  野的像风
    2021-02-18 20:27

    Instead of query you can use pipe:

    s.pipe(lambda x: x[x>0]).pipe(lambda x: x[x<10])
    

提交回复
热议问题