activitysim
activitysim copied to clipboard
Handle multi-index DataFrames in tracing.write_df_csv()
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