pandas: filter rows of DataFrame with operator chaining

前端 未结 14 2324
悲哀的现实
悲哀的现实 2020-11-22 16:46

Most operations in pandas can be accomplished with operator chaining (groupby, aggregate, apply, etc), but the only way I

14条回答
  •  长发绾君心
    2020-11-22 17:42

    My answer is similar to the others. If you do not want to create a new function you can use what pandas has defined for you already. Use the pipe method.

    df.pipe(lambda d: d[d['column'] == value])
    

提交回复
热议问题