function in python for replacing blank space with nan values for float type code example
Example: pandas replace empty string with nan
df = df.replace(r'^\s*$', np.NaN, regex=True)
df = df.replace(r'^\s*$', np.NaN, regex=True)