I am using Python 3 and below is my code which I am using to create clickable links once the data is returned from the data frame.
#Create Clickable Link Value
df_linky = df_sorted
df_linky['Thread'] = df_sorted['Title'] + '#&#' + df_sorted['Link']
def make_clickable_both(val):
name, url = val.split('#&#')
return f'<a href="{url}">{name}</a>'
df_compl = df_linky[['Thread','Score','Date Posted','Time Posted','Brand']]
df_complete = df_compl.reset_index(drop = True).set_index('Score')
df_complete = df_complete.style.format({'Thread': make_clickable_both})
return df_complete
I am getting an error in terminal
return f'<a href="{url}">{name}</a>'
^
SyntaxError: invalid syntax
And in the return value
429 {name} 2019-05-16 03:11 Smart Water
At the place of "{name}" it should be the name of the link, can any one suggest what is going wrong with this, I am using pandas library.