I have following data in my CSV:
"sepal_length,sepal_width,petal_length,petal_width,species"
"5.1,3.5,1.4,0.2,setosa"
"4.9,3,1.4,0.2,setosa"
"4.7,3.2,1.3,0.2,setosa"
Loading the file to convert to a numpy object:
import numpy as np
loaded_csv = np.genfromtxt('iris.csv', delimiter=',')
The output:
[[nan nan nan nan nan]
[nan 3.5 1.4 0.2 nan]
[nan 3. 1.4 0.2 nan]
[nan 3.2 1.3 0.2 nan]
[nan 3.1 1.5 0.2 nan]]
How to keep strings text and make the first element be considered a float?