2
I have a table . cvs and accurate
Print the employee with the highest amount billed each month, including employee name and total (example: "August 2020 - João - Total Billed: 150");
I got with the code below to get next to it.
Imagery: https://prnt.sc/xidwq9
# Read File
df = pd.read_csv('https://..../employee_billing.csv',sep=';')
df['Month'] = pd.Categorical(df['Month'],categories=["Apr", "May", "Jun", "Jul", "Aug", "Sep", "Nov", "Dec"],ordered=True)
df = df.sort_values(by=['Month', 'Day', 'Year'])
group = df.groupby(["Month", "Year", "Nome"]).sum()
billed = group["Billed"].groupby(level=0, group_keys=False)
billed.nlargest(1)
print(billed.nlargest(1))
But I can’t put the Billed Total (Total) in the last column.
Housekore, good afternoon! Provide test data, this way people can help you!
– lmonferrari