numpy.loadtxt, ValueError: could not convert string to float

You need to strip off the trailing ';' from the lines.

A possible workaround if you know you have 5 columns is:

np.loadtxt('test.csv', delimiter=";", usecols=range(5))

Or, use genfromtext instead which handles missing values

np.genfromtxt('test.csv', delimiter=";")[:,:-1]

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)