import pandas as pd
df = pd.read_excel('spam.xlsx', names = ['label', 'sms_message']) #Spam file includes lots of texts
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(df['sms_message'],
df['label'],
random_state=1)
from sklearn.naive_bayes import MultinomialNB
naive_bayes = MultinomialNB()
naive_bayes.fit(X_train,y_train)
我遇到错误: ValueError:无法将字符串转换为浮点型
那是为什么?我能做什么? 谢谢。