Another file may have a semicolon as a delimiter. So we need our data loader to be flexible enough to identify such delimiters in each row and extract the correct values from them. We’ll call the np.loadtxt function the same way as before, except that now we pass an additional parameter – ‘delimiter’: import numpy as npĭata = np.loadtxt('./weight_height_2.txt', delimiter = ',') Let us consider another file ‘ weight_height_2.txt’, it has the same data content as the previous one, but this time the values in each row are separated by a comma: This can be achieved by passing our delimiter as a parameter to the np.loadtxt function. This function will return the same array as before.