So here's my DataFrame:
a b c
0 1971 2154 203020339
1 1972 2648 191489250
2 1973 2690 193377651
3 1974 2676 201291002
4 1975 3276 275380446
I tried to make a very simple plot with it:
df.plot(x = df['a'], y = df['b'])
But I keep getting a Key Error message:
None of [Int64Index([1971, 1972, 1973, 1974, 1975], dtype='int64')] are in the [columns]
I tried to use convert column [a] to DateTime but I still got the same error message.
df['a'] = pd.to_datetime(df['a'], format='%Y')
question from:
https://stackoverflow.com/questions/65865201/key-error-none-of-int64index-dtype-int64-are-in-the-columns 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…