How to make all the values in a pandas DataFrame as False?

Question:

I have a DataFrame (close) like this:

enter image description here

How can I make all the values (including NaN and any float number) inside this DataFrame as False?

pandas.DataFrame.replace doesn’t seem to have this ability to achieve my goal.

Does anyone know how to do this?

Asked By: Brian

||

Answers:

You could do with assign

df[:] = False
Answered By: BENY
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.