A generalized recreation of the table I'm having issues with, which will come out being a table with 12000 rows and a MultiIndex. The big issue: I can't get this table to display in a rendered version of a Jupyter Notebook.
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randn(12000, 6), columns=list('ABCDCD'))
second_cols = ([''] * 2) + ['X', 'X', 'Y', 'Y']
df.columns = pd.MultiIndex.from_arrays([df.columns,second_cols])
df = df.swaplevel(0,1,1).sort_index(1)
df
My company uses proprietary software that lets us turn an .ipynb file into a interactive report. However, most of my issues are Jupyter notebook-level. Here's what I've tried and what's happened:
- Just display
df
: The tables print out, but only show rows [0:29, 19930:12000] and there is no sorting available. display(HTML(df.to_html()))
: gives me the following error:IOPub data rate exceeded. The notebook server will temporarily stop sending output to the client in order to avoid crashing it. To change this limit, set the config variable
--NotebookApp.iopub_data_rate_limit.
- DataViz and GoogleCharts do not support MultiIndexes.
Any ideas to make my dataframe render?! Perhaps packages that can paginate my table, etc? Note the big issue here is the MultiIndex.