I tried to check if a variable is equal to np.nan in the code(4th last line). But somehow I don\'t get a desired output while doing this rather when I use np.nan with check