numpy.leadtxt() function in Python
numpy.loadtxt() in Python is used load data from a text file, with aim to be a fast reader for simple text files.
Note that each row in the text file must have the same number of values.
Here is myfile.csv file content
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
5.8,2.7,4.1,1.0,Iris-versicolor
6.2,2.2,4.5,1.5,Iris-versicolor
6.4,3.1,5.5,1.8,Iris-virginica
6.0,3.0,4.8,1.8,Iris-virginicaLoad NumPy library
# import numpy library as np
import numpy as np
# numerical data file
filename="myfile.csv"