activitysim icon indicating copy to clipboard operation
activitysim copied to clipboard

Handle multi-index DataFrames in tracing.write_df_csv()

Open blakerosenthal opened this issue 5 years ago • 0 comments

The following check fails for multi-index DataFrames since df.index.name for multi-indices is a list, not a string and therefore df.index.name in df is false and the index gets wiped.

OD matrices frequently have a multi orig, dest index, so we could consider better handling of multi-indices throughout ActivitySim.

https://github.com/ActivitySim/activitysim/blob/09c3a9e7320640a0515f9ef99a9314d03f91a9b0/activitysim/core/tracing.py#L279

blakerosenthal avatar Sep 20 '19 16:09 blakerosenthal