This is the code to find the top three
import pandas as pd
df = pd.read_excel('test.xlsx')
Three = df.nlargest(3, 'AAA', keep='all')
Here is the code to change the color
import openpyxl
from openpyxl.styles import Font
wb = openpyxl.load_workbook('test.xlsx')
ws = wb.active
font = Font(size=12, bold=True, color="0000FF")
ws.cell(1, 2).font = font
wb.save('after.xlsx')
How can I mix the two, my final desired result is to have the top three data marked in red
Any help would be greatly appreciated