每次我在不同的数据集中使用 pandas 分析时,笔记本都会显示此错误。
IndexError:只有整数、切片 (
:)、省略号 (...)、numpy.newaxis (None) 和整数或布尔数组是有效索引。
import pandas as pd
df = pd.read_csv('H:\DATA Sets\cereal.csv')
from pandas_profiling import ProfileReport
profile = ProfileReport(df,title='cereal-eda',html={'style' : {'full_width':True}})
Run Code Online (Sandbox Code Playgroud)
使用的数据集 - 来自kaggle的gray.csv https://www.kaggle.com/crawford/80-cereals