Key Error: None of [Int64Index…] dtype='int64] are in the columns

前端 未结 5 2400
广开言路
广开言路 2020-12-17 16:49

I\'m trying to shuffle my indices using the np.random.shuffle() method, but I keep getting an error that I don\'t understand. I\'d appreciate it if someone could help me puz

5条回答
  •  萌比男神i
    2020-12-17 17:25

    Got the same error:

    KeyError: "None of [Int64Index([26], dtype='int64')] are in the [index]"
    

    Solved by Saving the dataframe to a local file and open it,

    like below:

    df.to_csv('Step1.csv',index=False)
    df = pd.read_csv('Step1.csv')
    

提交回复
热议问题