I have a dataframe as given below [input_dataframe]. I want the column Number to display as a clickable hyperlink. For e.g., under column Number, I want it to be displayed as 1234, but it should be as hyperlink and the link should be taken from the next column.
I tried the following code, but it is showing the entire hyperlink from the 2nd column twice in the first column [Output_dataframe]. Kindly help me in resolving this issue.
Code:
import pandas as pd
df = pd.read_excel("C:\\Users\\XYZ\\Desktop\\Test_1.xlsx",sheet_name='Sheet1')
df['Number'] = '<a href=' + df['url'] + '><div>' + df['url'] + '</div></a>'
df.to_excel("Test_2.xlsx",index=False)