Reputation: 11
Hello i am making a software which gets data from an API and puts it in excel in csv format using pandas.
df2 = pd.DataFrame(data, columns=["Certificate #", "Lab", "Shape", "Size", "Color", "Clarity", "Min", "Max", "Hgt", "Cut", "Depth", "Table", "Pol", "Sym", "Flour", "Key to Symbols", "Comments", "Type", "Rep. Date", "Stock #", "$/ct", "Rap", "Company"])
df2.to_csv(os.path.join(os.getcwd(), "OUTPUTS", "GiaOut_" + strftime("%d-%m-%Y") + "_" + sys.argv[1]))
data is a list of lists where each item is a string. i want the second column "Lab" to be a hyperlink. it should display the text "LAB" underlined in blue and a link behind it.
thanks
Upvotes: 1
Views: 806
Reputation: 416
df.to_excel
, all your formatting will not be gonna save. Instead of this, you have to create/open an excel spreadsheet through ExcelWriter
and have to save according to this code snippet.Upvotes: 1