clouddrift.adapters.gdp.str_to_float

Contents

clouddrift.adapters.gdp.str_to_float#

clouddrift.adapters.gdp.str_to_float(value: str, default: float = nan) float[source]#

Convert a string to float, while returning the value of default if the string is not convertible to a float, or if it’s a NaN.

Parameters#

valuestr

String to convert to float

defaultfloat

Default value to return if the string is not convertible to float

Returns#

outfloat

Float value of the string, or default if the string is not convertible to float.