piglot.optimisers.str_to_numeric

str_to_numeric(data: str) int | float | str[source]

Tries to convert a string to a numeric value.

Parameters

datastr

String to convert.

Returns

Union[int, float, str]

Converted value.