运行以下代码时,遇到错误KeyError: 'Requested level (var1) doesn't match index name (None)'。我使用了 python=3.7,jupyterlab=2.1.4,pandas-profiling=2.8。我尝试安装以前的 pandas-profiling 版本。但是有同样的错误。如果有人知道出了什么问题,我将不胜感激。
import numpy as np
import pandas as pd
from pandas_profiling import ProfileReport
df = pd.DataFrame(
np.random.rand(100, 5),
columns=["a", "b", "c", "d", "e"]
)
ProfileReport(df)
有关详细的错误消息,请参见下面的代码段: