python使用numpy模块报错ValueError: could not convert string to float 报这个错误,一般首先要检查文件中的元素是否有字符串型,如果这还不行的话,就是numpy数组无法自动识别你的文件分隔符 应该把读取文件的代码写为: data2 = np.loadtxt('real.csv', delimiter=',', skiprows = 1)