Hi,
I wanted to filter a column in the hail table based on two conditions.
ex: let’s say ‘AF’ is the column. We wanted to filter the rows whose values are less than 0.01 and also those rows which are having null/missing/NaN values.
We are trying to do this using the below code.
mt.filter(mt[‘AF’] < 0.01 | mt[‘AF’] == NA ) and its throwing an error.
TypeError: unsupported operand type(s) for |: ‘float’ and ‘Float64Expression’
What is the best way to do filtering based on multiple conditions?
mt.filter((mt[‘AF’] < 0.01) | (mt[‘AF’] == NA)) Needed more parens. The precedence of | is higher than < and the or from normal python. This is something we can’t change about python.