Thanks guys, that really helped. My main problem as you all pointed out was that I had 4 white spaces rather than a tab!
I have a textfile of the format:
string001 124.342
string002 235.111
string003 552.145
With a blank line at the bottom.
I just want to read this into an array. I thought that the best way to do this would be loadtxt from numpy, but when this didn't work, I went for genfromtxt, but couldn't quite get it to work either. This is what I have as my latest effort:
y = np.genfromtxt('1400list.txt',delimiter="\t", dtype=[('mystring','S10'),('myint','i8')])
print y
But I get the error:
rows = np.array(data, dtype=[('', _) for _ in dtype_flat])
ValueError: size of tuple must match number of fields.
Could anyone please help me to figure this one out?
Thank you!