SyntaxFix
Write A Post
Hire A Developer
Questions
It looks like your 'trainData' is a list of strings:
['-214' '-153' '-58' ..., '36' '191' '-37']
Change your 'trainData' to a numeric type.
import numpy as np np.array(['1','2','3']).astype(np.float)