它不允许我热编码该列,使其以二进制形式出现,任何想法为何,都不理解typerror。过去,使用相同的数据,IT可以完美地工作,不确定发生了什么事
<ipython-input-67-f853e47a6b2c> in <module>()
----> 1 dummies2=pd.get_dummies(x['call_type'])
2 x=pd.concat([x,dummies2], axis=1)
3 x
TypeError: list indices must be integers or slices, not str
这是我的数据集,它是json但转换为csv
0 6/14/17 21:54 10 14TH ST\, San Diego\, CA 1151 2.0 32.705449 -117.151870
1 3/29/17 22:24 10 14TH ST\, San Diego\, CA 1016 2.0 32.705449 -117.151870
2 6/3/17 18:04 10 14TH ST\, San Diego\, CA 1016 2.0 32.705449 -117.151870
3 3/17/17 10:57 10 14TH ST\, San Diego\, CA 1151 2.0 32.705449 -117.151870
4 3/3/17 23:45 10 15TH ST\, San Diego\, CA 911P 2.0 32.705722 -117.150350