首页 > 解决方案 > TypeError: 'int' 对象在使用 pandas read_csv() 时不可下标

问题描述

我正在使用pd.read_csv方法读取 csv,并且在使用 dtype 时出现类型错误:

TypeError:“int”对象不可下标

df = pd.read_csv(path, sep=separator, header=header_line, 
                 dtype={'id_technique':str,'type_opposition':str})   

我怎样才能解决这个问题 ?

标签: pythonpandas

解决方案


推荐阅读