dexplo / dataframe_image

A python package for embedding pandas DataFrames as images into pdf and markdown documents
https://dexplo.org/dataframe_image
MIT License
282 stars 41 forks source link

MultiIndex does not work with matplotlib #97

Open cheremovsky opened 1 year ago

cheremovsky commented 1 year ago

When table_conversion='matplotlib' is used multi-indexed dataframes are rendered incorrectly — multiindex is getting rolled back to the columns — as if I called .reset_index() dfi.export(last_reses, 'dream_strats.png', table_conversion='matplotlib')

How it looks:

Screenshot 2023-09-03 at 14 57 06

How it should look:

Screenshot 2023-09-03 at 14 57 45
PaleNeutron commented 1 year ago

It is as designed.

Multi-index calculation is too complex for current simulation way in matplotlib. But it will work in any browser convert method.

I am glad to accept a PR if you can provide an implementation.