如何解决这个错误?
我正在做一些矩阵计算:
dataset=pd.read_csv('sample.csv')
dataset = dataset.to_numpy()
#Normalize the features using mean normalization
dataset = ( dataset - dataset.mean() ) / dataset.std()
dataset.head()
我得到的错误是:
TypeError Traceback (most recent call last)
<ipython-input-122-74a855a3b4e2> in <module>
28
29 #Normalize the features using mean normalization
---> 30 dataset = ( dataset - dataset.mean() ) / dataset.std()
31
32 dataset.head()
~\anaconda3\lib\site-packages\numpy\core\_methods.py in _mean(a, axis, dtype, out, keepdims)
158 is_float16_result = True
159
--> 160 ret = umr_sum(arr, axis, dtype, out, keepdims)
161 if isinstance(ret, mu.ndarray):
162 ret = um.true_divide(
TypeError: can only concatenate str (not "float") to str