TypeError: loadtxt() got an unexpected keyword argument 'max_rows'

MRAB python at mrabarnett.plus.com
Tue Sep 3 13:11:54 EDT 2019


On 2019-09-03 17:29, Terry Reedy wrote:
> On 9/3/2019 12:02 PM, alberto wrote:
>> Hi,
>> I produce a script to elaborate data
>> 
>> but command line $ python3.4 PlotnhvsvdBTP1.py
>> 
>> I have this error
>> 
>> Traceback (most recent call last):
>> File "PlotnhvsvdBTP1.py", line 31, in <module>
>> UCvol = np.loadtxt(outputtransfile,skiprows=26,max_rows=1,usecols=[1])
>> TypeError: loadtxt() got an unexpected keyword argument 'max_rows'
>> 
>> How could fix it?
> 
> Don't do what the message says is the wrong thing to do.  Really.
> 
> In particular, don't pass 'max_rows=1'.  To find out what *to* do, read
> the doc for the loadtxt function.  From 'skiprows' and 'usecols', with
> no underscore, I suspect you should pass 'maxrows=1'.
> 
No, the documentation says "max_rows".

Apparently, consistency, like the argument, is optional. :-)



More information about the Python-list mailing list