human
How to write/read a Pandas DataFrame with MultiIndex from/to an ASCII file?
assistant
Here is some code to export a pandas data frame `df` to a file `mydf.tsv` and retain the indices

df.to_csv('mydf.tsv', sep='\t')

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.