Esempio n. 1
0
 def test_replaces_null_with_none_if_astype_is_not_int_or_float(self):
     self.assertIs(utilities.format_column(["none"], astype=str)[0], None)
Esempio n. 2
0
 def test_typecasts_to_float_by_default(self):
     self.assertIsInstance(utilities.format_column([1])[0], float)
Esempio n. 3
0
 def test_ignores_nan(self):
     self.assertIs(utilities.format_column([np.NaN])[0], np.NaN)
Esempio n. 4
0
 def test_ignores_non_null(self):
     self.assertIs(utilities.format_column([0.0])[0], 0.0)
Esempio n. 5
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)