[go: up one dir, main page]

Skip to content

Jupyter notebook renders a MultiIndex Dataframe misaligned

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

The ipynb render struggles to keep this particular multiindex dataframe aligned:

current expected
image image

Ref gitlab-org/ai-powered/custom-models/cm-notebooks!2 (comment 1976115662).

Example code to reproduce the problem

import pandas as pd

index = pd.MultiIndex.from_tuples(
    [('duo-chat with mistral', 'issues-epics')],
    names=['answering_model', 'dataset']
)

data = {
    1: [16],
    2: [3],
    3: [26],
    4: [36]
}

df = pd.DataFrame(data, index=index)
df.columns.name = "correctness"
df
Edited by 🤖 GitLab Bot 🤖