【发布时间】:2020-12-27 05:34:24
【问题描述】:
我想将链接列转换为超链接,以便在数据表上显示。
列链接如下所示:
link
0 https://twitter.com/CertSG/status/1286557929198563328
1 https://twitter.com/osiseguridad/status/1286565901568016384
我正在考虑创建一个函数来使用<a href = "x" </a> 转换字符串超链接,其中x 是0、1 的值等等。我也认为 for 可以帮助我实现它,但我真的不知道什么是更好的方法
type(df.link) 是 pandas.core.series.Series
我正在使用熊猫 3.8.5
我希望我的表格在表格中添加链接https://plotly.com/python/figure-factory-table/
非常感谢,我是新手
【问题讨论】:
-
你尝试了什么?
df.apply(your_function)怎么样? -
没有
pandas 3.8.5,但有Python 3.8.5和pandas 1.1.0 -
是的,你是对的。我对这个 python 世界很陌生,所以我犯了一个错误
标签: python string dataframe hyperlink