dataset=loadtxt('game/pima-indians-diabetes.csv') ValueError: could not convert string to float: b'6

dataset=loadtxt('game/pima-indians-diabetes.csv') ValueError: could not convert string to float: b'6_第1张图片


#引入xgboost包
from numpy import loadtxt
from xgboost import XGBClassifier
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split

#分出变量和标签
dataset=loadtxt('game/pima-indians-diabetes.csv')
修改:


#分出变量和标签
dataset=loadtxt('game/pima-indians-diabetes.csv',delimiter=",")



你可能感兴趣的:(python)