在调用python包 cpca 进行数据预处理时,使用python2.7开发
其中:
from cpca import *
# 其中addresslist为任意可迭代对象
df = transform(addresslist)
报错:TypeError: super() takes at least 1 argument (0 given)
由于python版本兼容问题导致
尝试用from future import 方式未解决
于是直接修改了cpca源码:
chmod 777 /usr/lib/python2.7/site-packages/chinese_province_city_area_mapper/domain.py
vim /usr/lib/python2.7/site-packages/chinese_province_city_area_mapper/domain.py
103 class Province(Place):
104
105 def __init__(self, name=""):
106 super(Province,self).__init__()
将super().__init__() 修改为上面所示
修改后执行报错:
TypeError: must be type, not classobj
103 class Province(Place,object):
104
105 def __init__(self, name=""):
106 super(Province,self).__init__()
103行处添加object 搞定!