Ejemplo n.º 1
0
 def test_csv_gz(self):
     with tmpfile(".csv.gz") as path:
         df = UntypedDf(sample_data())
         df.to_csv(path)
         df2 = UntypedDf.read_csv(path)
         assert list(df2.index.names) == [None]
         assert set(df2.columns) == {"abc", "123", "xyz"}
Ejemplo n.º 2
0
 def test_untyped_read_write_csv(self):
     with tmpfile(".csv") as path:
         for indices in [None, "abc", ["abc", "xyz"]]:
             df = UntypedDf(sample_data())
             if indices is not None:
                 df = df.set_index(indices)
             df.to_csv(path)
             df2 = UntypedDf.read_csv(path)
             assert list(df2.index.names) == [None]
             assert set(df2.columns) == {"abc", "123", "xyz"}