I have a dataframe df. I would like to replace all zeros with ones and all ones with zeros in the dataframe. Or in general, if I have to find some value (like one) and replace the value with something else, what's the best approach?
a b
1 1 0
2 0 1
3 1 0
4 0 0