python - 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})
我怎样才能解决这个问题 ?
解决方案
推荐阅读
- android - 录制内部音频不适用于 TV BOX
- r - 在 R 中自动绘制 x 个图形
- r - R中同时进行多个LASSO回归
- node.js - 显示从创建帖子开始的 dayjs 时间
- google-bigquery - Bigquery - 如何使用以前从聚合中创建的列?
- android-layout - 使用 DiffUtil,如何在更新 NestedScrollView 中包含的 recyclerView 时防止阻塞主线程?
- python - 使用 Selenium + Python 进行网页抓取
- php - 使用 gettext 过滤器从翻译的字符串中更改特定单词
- database - 对于响应式和可扩展的社交媒体应用程序来说,最好的数据库和编程语言是什么?
- java - 如何在每个 if 语句后重置数组?