# Otra RESOLUCIÓN ANALÍTICA
my_df2 = my_df.groupby('article_name').sum()
print(my_df2['quantity'].max())
413
# RESOLUCIÓN GRÁFICA
sns.barplot(x=my_df2.index, y=my_df2['quantity'], data = my_df2, order=my_df2.sort_values('quantity', ascending=True).index).set(title='Cantidad de productos vendidos')
plt.ylabel('Cantidad')
plt.xlabel('Tipo de producto')
plt.xticks(rotation=90)
plt.show()
article_name
Full Pc 538335.93
Notebook 251000.00
Smartphone 152250.00
Chair 69477.48
Tablet 48620.00
Name: total_amount, dtype: float64
# RESOLUCIÓN ANALÍTICA
df3 = my_df.groupby('seller_name').sum().sort_values('total_amount', ascending=False)
print(df3[['quantity']+['total_amount']].head(1))
quantity total_amount
seller_name
Janel O'Curran 703 192832.47
week quantity total_amount
seller_name
Arnold Kilkenny 143 583 94552.04
Aveline Swanwick 182 629 118874.33
Brockie Patience 125 441 142709.88
Cirilo Grandham 131 470 45009.40
Cornie Wynrehame 159 523 52253.57
Daisie Slograve 162 554 120520.11
Ewell Peres 150 496 78144.32
Janel O'Curran 174 703 192832.47
Jase Doy 160 582 80628.31
Kati Innot 135 512 83704.62
Milly Christoffe 112 442 61733.69
Oliviero Charkham 167 555 141329.76
Onida Cosely 148 535 77373.37
Tobin Roselli 126 519 56984.42
Vasily Danilyuk 150 521 129157.55
quantity total_amount
week
1 2449 507458.81
2 2444 415364.44
3 2114 329140.03
4 1058 223844.56
week quantity total_amount
country_name
Brazil 717 2515 441271.85
country_name
Brazil 441271.85
Argentina 205832.78
Colombia 177514.29
Peru 161421.12
Mexico 138619.99
Name: total_amount, dtype: float64