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