def test_categories_to_integers_big(self): data = os.path.join(os.path.abspath( os.path.dirname(__file__)), "data", "adult_set.txt") df = pandas.read_csv(data, sep="\t") trans = CategoriesToIntegers(single=True) trans.fit(df) newdf = trans.transform(df) self.assertEqual(len(newdf.columns), len(df.columns)) self.assertEqual(list(newdf.columns), list(df.columns)) newdf2 = trans.fit_transform(df) self.assertEqual(newdf, newdf2) rep = repr(trans) self.assertEqual("CategoriesToIntegers(columns=None,remove=None,single=True,skip_errors=False)", rep.replace(" ", "").replace("\n", ""))
def test_categories_to_integers_big(self): data = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data", "adult_set.txt") df = pandas.read_csv(data, sep="\t") trans = CategoriesToIntegers(single=True) trans.fit(df) newdf = trans.transform(df) self.assertEqual(len(newdf.columns), len(df.columns)) self.assertEqual(list(newdf.columns), list(df.columns)) # pylint: disable=E1101 newdf2 = trans.fit_transform(df) self.assertEqual(newdf, newdf2) rep = repr(trans) self.assertStartsWith("CategoriesToIntegers(", rep.replace(" ", "").replace("\n", "")) self.assertIn("single=True", rep.replace(" ", "").replace("\n", ""))