0

I want to be able to remove rows that are empty in column NymexPlus and NymexMinus right now the code I have is

df.dropna(subset=['NymexPlus'], inplace=True)

The thing about this code is that it will also delete rows in the column NymexMinus which I don't want to happen. Is there an If/AND statement that will work in terms of only getting rid of empty cells for both of the columns?

1 Answer 1

2

Use a list as subset parameter and how='all':

df.dropna(subset=['NymexPlus', 'NymexMinus'], how='all', inplace=True)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.