I have a .dat file that looks like this.
ID_1,5.0,5.0,5.0,...
ID_2,5.0,5.0,5.0,...
I'm trying to import the data into Python as an array.
If I do this, it'll give me a list of tuples.
data = np.genfromtxt('mydat.dat',
dtype=None,
delimiter=',')
However, when I do the following it gives an odd result, probably because that first element is not a float.
np.fromfile('mydat.dat', dtype=float)
array([ 3.45301146e-086, 3.45300781e-086, 3.25195588e-086, ...,
8.04331780e-096, 8.04331780e-096, 1.31544776e-259])
Any suggestions on this? These were the two main ways to import .dat files into Python as an array and they don't seem to provide the desired result.