Closed djinnome closed 6 years ago
Interesting...I'm going to try this out today. I would expect MultiIndexed Dataframes to work (but qgrid just doesn't look "grouped") but maybe this is a case I haven't tried before. If you have code which creates a sample DataFrame to reproduce this that would be helpful. Otherwise I can probably figure it out.
I was able to reproduce it, no need for the code sample, thanks. Seems that the method that qgrid uses in pandas to serialize dataframes to json does not support DataFrames where the columns
axis is set to a MultiIndex (see https://github.com/pandas-dev/pandas/issues/15996). A DataFrame with it's index
set to a MultiIndex works as expected in qgrid (although the display could be improved because the grid doesn't look "grouped")
Flattening the columns as described here is still the best workaround. I have some ideas of how to fix this in qgrid but I'm not sure when I'll get to it...there are some other smaller projects that I think provide better ROI (since this seems like it will require a significant change).
I'm going to close this as a duplicate of https://github.com/quantopian/qgrid/issues/18 but thanks for bringing it to my attention.
Environment
$ python --version
. Python 3.6.1 :: Anaconda custom (x86_64)pip
,conda
, orother (please explain)
) . conda$ pip freeze
or$ conda list
(please include qgrid, notebook, and jupyterlab versions) See below. It is very long.$ jupyter labextension list
. Doesn't work on JupyterLab. Trying on Jupyter notebook does work.Description of Issue
NotImplementedError: orient='table' is not supported for MultiIndex
Reproduction Steps
qgrid.show_grid(df)
...
What steps have you taken to resolve this already?
Anything else?
Here is the output of
conda list