Insert a link inside a Pandas table

I suppose you have to represent whole Pandas object as an HTML object, that is

In [1]: from IPython.display import HTML

In [2]: df = pd.DataFrame(list(range(5)), columns=['a'])

In [3]: df['a'] = df['a'].apply(lambda x: '<a href="http://example.com/{0}">link</a>'.format(x))

In [4]: HTML(df.to_html(escape=False))

Sorry, now I don’t have IPython at hand, and can’t check whether the output is correct.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)