I am trying to read a csv file of that looks like:
label,value
first,1.234e-01
second,5.678e-02
three,9.876e-03
...
etc
Where the first column contains strings and the second column contains floats.
From the online documentation of np.genfromtxt I thought that the line
file_data = np.genfromtxt(filepath, dtype=[('label','<U'),('value','<f4')], delimiter=',', skip_header=1)
would specify the dtype of each column which would allow it to be read appropriately but when I try to print file_data I get something that looks like
[('', 1.234e-01) ('', 5.678e-02) ('', 9.876e-03) ...]
when I was expecting
[('first', 1.234e-01) ('second', 5.678e-02) ('third', 9.876e-03) ...]