Numpy.genfromtxt method works on Windows but not Linux

I do data hashing, and I created a program for Python on Windows, and now I want to run it on my Linux box so that it can crunch while I get home to drink beer, etc.

One piece of code (important) swallows some column values ​​from a CSV file using the Numpy genpromtxt method. code snippet:

rfd_values = np.genfromtxt(file_in, delimiter=',',
             skip_header=1,
             invalid_raise=0,
             usecols = cols)

So, the idea is here: skip the header, the separator is a comma and give me only the columns from the list called by cols. This works on a Windows laptop (e.g. Python and Numpy, 2.6 and 1.5 respectively), but when I run it on Linux, it tells me:

* TypeError: genfromtxt () received an unexpected keyword argument 'skip_header' *

I tried putting everything on one line and changing the quotation marks for the separator keyword, but that didn't seem to work. Most likely, this is something stupid, but I can not appear on it. I went through a bunch of Numpy forums and docs and didn’t see anything like what I saw. I wonder what I am missing.

I would really appreciate your understanding.

Thanks in advance!

-Jeff

+3
source share
1 answer

, 1.3 Linux. skiprows, skip_header. numpy.genfromtxt 1.3, , 1.3, . , , . names=True. , ( , usecols).

. invalid_raise 1.3.

+3

Source: https://habr.com/ru/post/1787834/


All Articles