import pandas as pd
import xlsxwriter
from datetime import datetime
import sys
path = sys.argv[1]
xl = pd.ExcelFile(path)
df = xl.parse("Sheet1")
df.columns = ['Nume', 'Tip de', 'Unit', 'Speciale Price', 'Suma de', 'Suma']
def highlight_max(x):
return ['background-color: yellow' if v == x.max() else ''
for v in x]
df.style.apply(highlight_max)
df.loc[-1] = ['Totul', '', '', '', df['Suma de'].sum(), df['Suma'].sum()]
I tried to apply highlight_max to columns
from Why does not work styling in Pandas Excel?
No comments:
Post a Comment