In [1]:
from netflowpandasmodel import dataFactory
In [2]:
assert not dataFactory.csv.find_duplicates("csv_data")
dat = dataFactory.csv.create_tic_dat("csv_data", freeze_it=True)
dat
now has the data in TicDat
format (i.e. just dicts of dicts). For example -
In [3]:
dat.cost
Out[3]:
We can easily create a copy where each table is a pandas.DataFrame
.
In [4]:
pandat = dataFactory.copy_to_pandas(dat)
By default, the primary key fields are represented in the index of the tables and not the columns of the tables.
In [5]:
pandat.cost
Out[5]:
However, this is easy to change if you'd rather none of the columns be dropped.
In [6]:
pandat = dataFactory.copy_to_pandas(dat, drop_pk_columns=False)
pandat.cost
Out[6]:
In [ ]: