使用 python 将超链接添加到 csv

Adding hyperlink to a csv using python

我正在尝试向 csv 添加超链接。我从 ArcGIS Survey123 导出数据和附件。 csv只有照片的文件名,

photos_20220216144827.jpg, photos_20220329110509.jpg, 60th_virtual_background.jpg

我想添加超链接以便更快地访问图像。所有照片都保存在以下目录B:\Survey123\survey_attachments

我用这行代码就搞定了。

# Adding hyperlink
df = pd.read_excel(surveyResults)
df['Column containing image name'] = '=HYPERLINK("location of folder containing images' + df["Column containing image name"] + '")'
df.to_excel('location where to save new excel', index=False)