data.replace(0, np.nan, inplace=True) data.replace("NaT", np.nan, inplace=True) data.replace("nan", np.nan, inplace=True)