I want to write a multi-index dataframe to excel:
col = [['info', '', 'key'], ['alert', 'date', 'price'], ['alert', 'date', 'amount']]
df = pd.DataFrame(columns = pd.MultiIndex.from_tuples(col))
df.loc[0, :] = np.random.random(3)
df.to_excel('data.xlsx', index = False)
However, an error occurs:
NotImplementedError: Writing to Excel with MultiIndex columns and no index ('index'=False) is not yet implemented.
I checked pandas version : pd.__version__ and the result is '0.25.3'.
How to solve the problem?
Thank you.
