I have a tsv-file from QuickDAQ with three columns of 200 000 values that I want to import into numpy. Problem is genfromtxt seems to miss the last line. The line is nothing out of the ordinary as far as I can see:
...
0,00232172012329102 0,0198968648910522 0,0049593448638916
0,00411009788513184 0,0142784118652344 0,00339150428771973
0,00499653816223145 0,00666630268096924 0,00308072566986084
Example of code that doesn't quite work:
In [245]: import numpy as np
In [246]: oompa = np.genfromtxt('C_20k_73_2.tsv',delimiter='\t',usecols=(0,1,2),unpack=True,skip_header=13,dtype=str)
In [248]: oompa[1]
Out[248]:
array(['-0,00884926319122314', '-0,00379836559295654',
'0,000106096267700195', ..., '0,0259654521942139',
'0,0198968648910522', '0,0142784118652344'],
dtype='<U21')
The file had windows-style line breaks, I've tried removing these in vi but it doesn't make a difference. What could cause this kind of behaviour from genfromtxt and how could it be dealt with, preferably without manually editing the tsv file?