Esempio n. 1
0
 def test_wrap_multilayer(self):
     # not fully supported yet, but let's check that it's reasonable
     rows = ["yes", "no", "maybe"]
     cols = [("animal", "cat"), ("animal", "armadillo", ("person", "matt"))]
     cols = pd.MultiIndex.from_tuples(cols)
     df = pd.DataFrame(np.zeros((3, 2)), rows, cols)
     df = TypedDfs.wrap(df)
     assert df.column_names() == [
         ("animal", "cat", np.nan),
         ("animal", "armadillo", ("person", "matt")),
     ]
Esempio n. 2
0
 def test_wrap(self):
     df = pd.DataFrame({})
     df2 = TypedDfs.wrap(df)
     assert not isinstance(df, AbsDf)
     assert isinstance(df2, BaseDf)