def test_replaces_null_with_none_if_astype_is_not_int_or_float(self): self.assertIs(utilities.format_column(["none"], astype=str)[0], None)
def test_typecasts_to_float_by_default(self): self.assertIsInstance(utilities.format_column([1])[0], float)
def test_ignores_nan(self): self.assertIs(utilities.format_column([np.NaN])[0], np.NaN)
def test_ignores_non_null(self): self.assertIs(utilities.format_column([0.0])[0], 0.0)
def test_replaces_null_with_nan(self): self.assertIs(utilities.format_column([" "])[0], np.NaN) self.assertIs(utilities.format_column(["none"])[0], np.NaN) self.assertIs(utilities.format_column(["NAN"])[0], np.NaN) self.assertIs(utilities.format_column(["na"])[0], np.NaN) self.assertIs(utilities.format_column(["undefined"])[0], np.NaN)