replace ? with NaN value code example Example 1: python pandas replace nan with null df.fillna('', inplace=True) Example 2: how to replace nan values with 0 in pandas df.fillna(0)