In Jupyter, when displaying a dataframe with a MultiIndex, the first level is left-aligned.
import numpy as np
cols = pd.MultiIndex.from_tuples([(x, y) for x in ['A', 'B', 'C'] for y in ['O', 'I']])
df = pd.DataFrame(np.random.randn(2, 6), index=['n', 'm'], columns=cols)
df
When displaying the same using pandas styler, it becomes right-aligned, however:
df.style
How can I control the alignment?


