python - Numpy.genfromtxt method works in windows but not Linux -
i doing data crunching , have built program python in windows , want run on linux box can crunch while go home drink beer, etc.
one piece of code (an important one) ingests columnar values csv file via numpy's genfromtxt method. snippet of code in question is:
rfd_values = np.genfromtxt(file_in, delimiter=',', skip_header=1, invalid_raise=0, usecols = cols)
so idea here is, skip header, delimiter comma, , give me columns list callled cols. works hunky-dorey on windows laptop (same version of python , numpy, 2.6 , 1.5 respectively), when run in linux tells me:
*typeerror: genfromtxt() got unexpected keyword argument 'skip_header'*
i tried putting on 1 line, , changing quotes around delimiter keyword, didn't seem work. silly, can't seem put finger on it. looked through bunch of forums , numpy docs , didn't see sounded close seeing. wondering missing.
i appreciate insight.
thanks in advance!
-jeff
you said you're using version 1.3 on linux. 1 has argument skiprows
same skip_header
. considering numpy.genfromtxt
isn't in documentation 1.3, guess being tested in 1.3, , final signature wasn't quite set. being said, there workaround case. can use names=true
keyword parameter, instead. in case, first row used not data, determine column names (which can use, instead of column numbers in list passed usecols
).
but there's problem. invalid_raise
argument isn't in 1.3 either.
Comments
Post a Comment