How to make all the values in a pandas DataFrame as False?
Question:
I have a DataFrame (close
) like this:
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?
Answers:
You could do with assign
df[:] = False
I have a DataFrame (close
) like this:
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?
You could do with assign
df[:] = False