def test_replace_empty_string_with_none(): df = pd.DataFrame({"a": ["", 1, 0.34, "6.5", ""]}) df_expected = pd.DataFrame({"a": [None, 1, 0.34, "6.5", None]}) df["a"] = _replace_empty_string_with_none(df["a"]) assert_series_equal(df["a"], df_expected["a"])
def test_empty_string_input(): assert _replace_empty_string_with_none("") is None
def test_int_input(): assert _replace_empty_string_with_none(4) == 4
def test_float_input(): assert _replace_empty_string_with_none(4.0) == 4.0