I have two columns in the table, speed and power. I would like to exclude any 0 for power where speed is greater than 5.
So far I have
df[(df.sum(axis=1) != 0)]
which will exclude all 0 values but how do I amend that to also exclude all speeds greater than 5, while also including below 5?