I have the following array:
myarray
array([4805, 5019, 5066, 5033, 5089, 5068, 5103, 5111, 5098, 5112, 5036,
5010])
I am trying to normalize the data using sklearn function
sklearn.preprocessing.normalize(myarray)
and I get the following error message
/...python3.4/site-packages/sklearn/preprocessing/data.py in normalize(X, norm, axis, copy)
551 norms[norms == 0.0] = 1.0
552 elif norm == 'l2':
--->553 norms = row_norms(X)
554 norms[norms == 0.0] = 1.0
555 X /= norms[:, np.newaxis]
/.../python3.4/site-packages/sklearn/utils/extmath.py in row_norms(X, squared)
63 norms = csr_row_norms(X)
64 else:
---> 65 norms = np.einsum('ij,ij->i', X, X)
66
67 if not squared:
ValueError: einstein sum subscripts string contains too many subscripts for operand 0
I converted the array to pandas.Series but I still get the same error message.
Any advice is much appreciated.