def string_is_complex(series, state: dict) -> bool: def f(s): return s.apply(complex) coerced_series = test_utils.option_coercion_evaluator(f)(series) return (coerced_series is not None and not string_is_float(series, state) and test_imaginary_in_string(series))
def test_string_is_float(series: pd.Series) -> bool: coerced_series = test_utils.option_coercion_evaluator(string_to_float)( series) if coerced_series is not None and coerced_series in Float: return test_string_leading_zeros(series, coerced_series) return False
def test_string_is_int(series) -> bool: coerced_series = test_utils.option_coercion_evaluator(string_to_int)(series) return coerced_series is not None and coerced_series in Integer
def test_string_is_float(series) -> bool: coerced_series = test_utils.option_coercion_evaluator(to_float)(series) return coerced_series is not None and coerced_series in visions_float
def test_string_is_complex(series) -> bool: coerced_series = test_utils.option_coercion_evaluator(to_complex)(series) return coerced_series is not None and not test_string_is_float(series)
def string_is_float(series: pd.Series, state: dict) -> bool: coerced_series = test_utils.option_coercion_evaluator(f)(series) return (coerced_series is not None and coerced_series in Float and test_string_leading_zeros(series, coerced_series))
def test_is_float(series: pd.Series) -> bool: coerced_series = test_utils.option_coercion_evaluator(to_float)(series) return coerced_series is not None and coerced_series in Float