I\'m getting this error when trying to predict using a model I built in scikit learn. I know that there are a bunch of questions about this but mine seems different from the
Below correction to original answer from Scratch'N'Purr would help solve issues one might face using string as value for new inserted column 'label' -
train_df = pd.read_csv("Cinderella.csv")
train_df['label'] = 1
score_df = pandas.read_csv("Slaughterhouse_copy.csv")
score_df['label'] = 2
# Concat
concat_df = pd.concat([train_df , score_df])
# Create your dummies
features_df = pd.get_dummies(concat_df)
# Split your data
train_df = features_df[features_df['label'] == '1]
score_df = features_df[features_df['label'] == '2]
...