replace floats in dataframe with nan code example Example: replace floats in dataframe df = df.mask(np.isclose(df.values, 0.997345))