Problem solving: Pandas: keyerror: [ ] not in index

After data cleaning with packages like Numpy and Pandas, the corresponding columns in dataframe will be fed into models such as neural network or SVM as features or labels for model training. During this process, errors as shown in the question are likely to be encountered, such as:

X=data[features]
Y=data['6A']

The error was reported as follows:

was modified as follows:

X=data.iloc[:,1:21

Read More: