Esempio n. 1
0
 def test_of(self):
     expected = [[1, 2, 3], [4, 5, 6]]
     df = UntypedDf.convert(pd.DataFrame(sample_data()))
     assert df.to_numpy().tolist() == expected
     df = UntypedDf.of(pd.DataFrame(sample_data()))
     assert df.to_numpy().tolist() == expected
     df = UntypedDf.of(sample_data())
     assert df.to_numpy().tolist() == expected
Esempio n. 2
0
 def test_concat_no_preserve_attrs(self):
     df0 = Col1([pd.Series(dict(abc="hippo"))])
     df1 = df0.set_attrs(animal="fishies")
     df2 = df0.set_attrs(animal="hippos")
     df = UntypedDf.of([df1, df2])
     assert df0.attrs == {}
     assert len(df) == len(df1) + len(df2) > 0
     assert df.attrs == {}
Esempio n. 3
0
 def test_of_concat(self):
     df1 = UntypedDf.of(pd.DataFrame(sample_data()))
     df2 = UntypedDf.of(pd.DataFrame(sample_data()))
     df = UntypedDf.of([df1, df2])
     assert len(df) == len(df1) + len(df2) > 0