My code looks something like this where i am trying to make a table of column "Supplier" and "Discount"
Discount_By_Suppliers = data.groupby(["Supplier"])["Discount"].sum()
Top_20_suppliers = Discount_By_Suppliers.nlargest(25)
print(Top_20_suppliers)
Top_20_suppliers.to_html('index.html')
what i am doing wrong? please help.
I just came across this and see that it has not been "answered". As @dimension said, convert to a DataFrame and then .to_html() will will work.
Top_20_suppliers = pd.DataFrame(Top_20_suppliers)
Top_20_suppliers.to_html('index.html')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With