The to_dataframe method currently handles lists, dictionaries, and scalar variables. Ideally, a similar approach could convert more complex vector-style variables such as path_tpc, grades, curves, etc.
As an example, path_tpc entails a list of LinkPoint objects, each of which has a LinkIdx object, each of which has an idx variable.
Currently, retrieving a path_tpc requires something like this:
points = []
for i in range(len(train_sim.path_tpc.link_points)):
points.append(train_sim.path_tpc.link_points[i].link_idx.idx)
dataframes.append(
pl.DataFrame({"link_idx":points})
.with_row_index("step"))
)`
Ideally, the following:
train_sim.to_dataframe(key_substrings_to_keep=["path_tpc.link_points(.*)link_idx"])
would return a "long-format" dataframe. (Currently, each link_idx.idx will appear as a separate column in a single-row dataframe).
The
to_dataframemethod currently handles lists, dictionaries, and scalar variables. Ideally, a similar approach could convert more complex vector-style variables such aspath_tpc,grades,curves, etc.As an example,
path_tpcentails a list ofLinkPointobjects, each of which has aLinkIdxobject, each of which has anidxvariable.Currently, retrieving a
path_tpcrequires something like this:Ideally, the following:
would return a "long-format" dataframe. (Currently, each
link_idx.idxwill appear as a separate column in a single-row dataframe).