Identify and Replace NaN values from a pandas dataframe

I am working on a complex image processing algorithm where in majority of the steps perform mathematical tasks to be performed on the image dataset. To perform these mathematical operations without any error on the image I need to pre-process the image data and the most important part of this data pre-processing is the identification and rectification of the unavailable data. Considering the image representation in the form of dataset as below, i am required to convert the NaN values to 0, because currently with this set of data, i am getting error as mentioned.

Already tried using isNaN function, but no fruitful results.


   0       1  2
 0 1.5   2.8 3.4 
 1 3.2  Nan 
 2 5  3.6 2.0 


ValueError: cannot convert float NaN to integer