3

When running below code, running into error KeyError: 'Requested level (var1) does not match index name (None)'. I used python=3.7, jupyterlab=2.1.4, pandas-profiling=2.8. I tried to install previous pandas-profiling versions. But had the same error. I'd appreciate if anyone has any idea what went wrong.

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)

See below snippet for detailed error message:

Detailed error message

hlan2
  • 31
  • 3

1 Answers1

0

That problem disappeared after I upgraded pandas profiling to the latest version.

pandas-profiling (2.3.0) -> Latest: 2.8.0

fdb
  • 1
  • 1
  • Do you run this line in the Jupyter notebook or the terminal? I get the error message `Input In [17] pandas-profiling (2.3.0) -> Latest: 2.8.0 ^ SyntaxError: invalid syntax ` – merry123 Jul 22 '22 at 13:33