问题,以下代码为什么KeyError: “None of [Index([‘r1’, ‘r2’], dtype=‘object’)] are in the [index]”:
import pandas as pd
data = pd.read_excel(r'C:\Users\ASUS\Desktop\结果\碳密度.xlsx', sheet_name=0)
d = data.loc[['r1', 'r2'], ['c1', 'c3']]
print(d)
我的表是这样的,明明有这些行啊
谢谢各位前辈的指导!!!