我正在尝试使用for循环生成链接,并尝试像以下示例一样将它们添加到我的空数据框中:
但是我遇到以下错误:
想要以下结果:
linkdf = pd.DataFrame(columns=['Link'])
for i in range(1,10):
l = 'https://google.com/assets/' + str(i)
linkdf = linkdf.append(l)
但是我遇到以下错误:
是否有一种方法可以将其添加到已提供标题的空数据框中。TypeError: 无法连接类型为“<class 'str'>”的对象;只有Series和DataFrame obj是有效的。
想要以下结果:
Link
0. https://google.com/assets/1
1 https://google.com/assets/2
2. https://google.com/assets/3
感谢任何帮助 谢谢