using 'OR' to select data in pandas

后端 未结 1 329
Happy的楠姐
Happy的楠姐 2021-01-19 06:25

I have a dataframe of values and I would like to explore the rows that are outliers. I wrote a function below that can be called with the groupby().apply() func

相关标签:
1条回答
  • 2021-01-19 07:10

    You need to use | instead of or. The and and or operators are special in Python and don't interact well with things like numpy and pandas that try to apply to them elementwise across a collection. So for these contexts, they've redefined the "bitwise" operators & and | to mean "and" and "or".

    0 讨论(0)
提交回复
热议问题