TypeError:+不支持的操作数类型:“ float”和“ unicode”

时间:2019-03-08 16:39:17

标签: python python-2.7

目前,我正在尝试合并具有特定路径的域列表。当尝试将域与特定路径结合在一起时,出现错误。

TypeError:+不支持的操作数类型:“ float”和“ unicode”

我目前正在阅读两个Excel文档。这是代码:

import pandas as pd
import urllib


apps = pd.read_excel("test.xlsx", "Sheet1")
pdirs= pd.read_excel("dirs.xlsx", "Sheet1")

urls = apps['Domains'].values.tolist()
dirs = pdirs['DIR'].values.tolist() 

for websites in urls:
    for directory in dirs:
        testURL= websites + directory
        print (testURL)

网站的格式如test.test.com,目录变量的格式如/ test。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您最好打字。我的意思是 str(websites) + str(directory)