I want to load data from a text file of the following format:
Sarah, 0.5 0.2 2.0
Where (0.5, 0.2, 2.0) is a vector that describes Sarah. The vector is shortened here. In the actual textfile the vector spans multiple lines.
I have tried :
data = np.genfromtxt(filename, dtype =[("label","U10"),("description","f4",(3,))], delimiter = ",")
However I end up with the following error code:
ValueError: could not assign tuple of length 2 to structure with 4 fields.
Ideally what I want is that I could access the vector description like this :
data["description"]