pandas KeyError: “[’’] not found in axis” 错误的解决方法 原因 就是没有找到这个行或者列 DataFrame数据 ,行有索引,列有名字。不要用索引找列,用名字找行。 典型错误 KeyError: “[‘A’] not found in axis” import pandas as pd df = pd.DataFrame({ 'A': ['A0', 'A1', 'A2', 'A3'], 'B': ['B0', 'B1', 'B2', 'B3'