New column in Pandas dataframe based on boolean conditions

前端 未结 2 472
不知归路
不知归路 2021-01-18 19:57

I\'d like to create a new column to a Pandas dataframe populated with True or False based on the other values in each specific row. My approach to solve this task was to app

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-18 20:27

    In your current setup, just re-write your function like this:

    def ops_on(row):
        return (row['Feed'] > 10) & (row['Pressure'] > 10) & (row['Temp'] > 10)
    

提交回复
热议问题