|
请教各位大侠,运行程序的时候,一直提示报错:
Traceback (most recent call last):
File "C:/Python_3.6/Python_File_Py/EX_001/003.py", line 14, in <module>
address = house_num + ' ' + street + "," + city
TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('<U21') dtype('<U21') dtype('<U21')
引用的表格上传附件了,谢谢了!
代码如下:
- import xlrd # 导入xlrd模块
- import requests # 导入requests模块
- from datetime import date, datetime # 从模块datetime中导入函数date,datetime
- import pandas as pd # 导入pandas大熊猫模块,并将其命名为pd
- from math import sin, asin, cos, radians, fabs, sqrt
- loc_list = [],
- df = pd.read_excel('C:\Python_3.6\Python_File_Py\EX_001\\KS_01.xlsx')
- rows = df.iloc[:, 0].size # 行数 3
- for indexs in df.index:
- street = df.loc[indexs].values[0]
- house_num = df.loc[indexs].values[1]
- city = df.loc[indexs].values[2]
- address = house_num + ' ' + street + "," + city
- print(addressqingwen
复制代码
|
|