当前位置:网站首页>[usecols parameter of pd.read\u excel ((), list error reason]

[usecols parameter of pd.read\u excel ((), list error reason]

2022-06-22 07:14:00 Running_ sdeer

pd.read_excel(() And usecols Parameters , List error

Pandas version:0.23.4
1、Str- type :excel Default alphabetic column name ,usecols=‘A,B,C’ perhaps ’A:C’ perhaps ’A,B:C’, Or enclosed in parentheses ,usecols=(‘A,B:C’), A tuple . In square brackets , That is, the list will report an error .
2、int-list type : The parameter value is list [0,1,2,5], The read columns can only be listed one by one
3、str-list type :**0.23 Version not supported ,0.24 Later versions support ****usecols=[‘foo’, ‘bar’], Is the column name in the table
4、 function : The passed in function determines whether the column value is true, Such as usecols=lambda x: x.isalpha().

原网站

版权声明
本文为[Running_ sdeer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202220539387284.html