How to create a table with clickable hyperlink in pandas & Jupyter Notebook

前端 未结 4 1615
北荒
北荒 2020-11-27 17:19

print(\'http://google.com\') outputs a clickable url.

How do I get clickable URLs for pd.DataFrame([\'http://google.com\', \'http://duckduckgo.com

4条回答
  •  旧时难觅i
    2020-11-27 18:04

    Try using pd.DataFrame.style.format for this:

    df = pd.DataFrame(['http://google.com', 'http://duckduckgo.com'])
    
    def make_clickable(val):
        return '{}'.format(val,val)
    
    df.style.format(make_clickable)
    

    I hope this proves useful.

提交回复
热议问题