Muestra de datos
article_id article_name unit_price
0 20015 Smartphone 525.00
1 20016 Full Pc 2127.81
2 20017 Monitor 230.00
3 20018 Tablet 130.00
4 20019 Desk 130.10
Formato del dataframe
(31, 3)
Búsqueda de valores nulls por columna
article_id 0
article_name 0
unit_price 0
dtype: int64
Formato de los datos por columna
article_id int64
article_name object
unit_price object
dtype: object
Muestra de datos
seller_name
seller_id
1 Aveline Swanwick
2 Jase Doy
3 Oliviero Charkham
4 Cornie Wynrehame
5 Ewell Peres
Formato del dataframe
(15, 1)
Búsqueda de valores nulls por columna
seller_name 0
dtype: int64
Formato de los datos por columna
seller_name object
dtype: object
Muestra de datos
order_id week article_id quantity seller_id country_name
0 15024 1 20039 10 10 Peru
1 15025 1 20029 15 5 Peru
2 15026 1 20024 5 14 Bolivia
3 15027 1 20018 9 14 Brazil
4 15028 1 20035 6 15 Mexico
Formato del dataframe
(1000, 6)
Búsqueda de valores nulls por columna
order_id 0
week 0
article_id 0
quantity 0
seller_id 0
country_name 0
dtype: int64
Formato de los datos por columna
order_id int64
week int64
article_id int64
quantity int64
seller_id int64
country_name object
dtype: object
df_articles['unit_price'] = df_articles['unit_price'].astype(float)
print(df_articles.dtypes)
article_id int64
article_name object
unit_price float64
dtype: object
week quantity country_name article_name total_amount seller_name
0 1 10 Peru Water Cooling 675.0 Cirilo Grandham
1 1 15 Peru Mouse 454.5 Ewell Peres
2 1 5 Bolivia Netbook 725.0 Janel O'Curran
3 1 9 Brazil Tablet 1170.0 Janel O'Curran
4 1 6 Mexico Case 227.4 Daisie Slograve
.. ... ... ... ... ... ...
995 4 1 Brazil Modem 67.5 Kati Innot
996 4 15 Brazil Heatsink 150.0 Daisie Slograve
997 4 2 Colombia Heatsink 20.0 Vasily Danilyuk
998 4 14 Brazil Tablet 1820.0 Vasily Danilyuk
999 4 12 Brazil SDD 264.0 Onida Cosely
[1000 rows x 6 columns]
ARTÍCULO QUE MÁS APARECE EN LAS ÓRDENES
HDD 47
Netbook 45
SDD 45
Tablet 40
Usb Cable 39
Name: article_name, dtype: int64
ARTÍCULO QUE MÁS CANTIDAD SE VENDIÓ
quantity
article_name
HDD 413
Tablet 374
SDD 372
Mouse 322
Netbook 320
article_name
Full Pc $ 538,335.93
Notebook $ 251,000.00
Smartphone $ 152,250.00
Chair $ 69,477.48
Tablet $ 48,620.00
Name: total_amount, dtype: float64
quantity total_amount
seller_name
Janel O'Curran 703 $ 192,832.47
Brockie Patience 441 $ 142,709.88
Oliviero Charkham 555 $ 141,329.76
Vasily Danilyuk 521 $ 129,157.55
Daisie Slograve 554 $ 120,520.11
quantity total_amount
week
1 2449 $ 507,458.81
2 2444 $ 415,364.44
3 2114 $ 329,140.03
4 1058 $ 223,844.56
VENTAS POR PAIS
total_amount
country_name
Brazil $ 441,271.85
Argentina $ 205,832.78
Colombia $ 177,514.29
Peru $ 161,421.12
Mexico $ 138,619.99
Venezuela $ 77,684.52
El Salvador $ 57,391.26
Guatemala $ 52,579.25
Honduras $ 36,763.56
Costa Rica $ 34,606.50
Chile $ 24,660.98
Bolivia $ 22,682.80
Uruguay $ 17,843.09
Ecuador $ 17,475.30
Paraguay $ 8,195.12
Puerto Rico $ 1,265.43
RECAUDACIÓN ARGENTINA Y BRAZIL DURANTE EL MES
week country_name total_amount
0 1 Argentina $ 63,760.48
1 1 Brazil $ 165,289.90
2 2 Argentina $ 96,789.13
3 2 Brazil $ 106,803.85
4 3 Argentina $ 26,601.97
5 3 Brazil $ 79,341.50
6 4 Argentina $ 18,681.20
7 4 Brazil $ 89,836.60
MEJORES 5 VENDEDORES
seller_name quantity total_amount
7 Janel O'Curran 703 $ 192,832.47
2 Brockie Patience 441 $ 142,709.88
11 Oliviero Charkham 555 $ 141,329.76
14 Vasily Danilyuk 521 $ 129,157.55
5 Daisie Slograve 554 $ 120,520.11
<ipython-input-20-3742e15cb0db>:3: FutureWarning: Indexing with multiple keys (implicitly converted to a tuple of keys) will be deprecated, use a list instead.
df10=df10.groupby(['seller_name'])['quantity','total_amount'].sum().reset_index().sort_values(by='total_amount',ascending=False).head()
MEJORES 5 VENDEDORES DE BRAZIL
country_name seller_name quantity total_amount
5 Brazil Daisie Slograve 226 $ 65,283.28
1 Brazil Aveline Swanwick 227 $ 58,771.48
0 Brazil Arnold Kilkenny 184 $ 47,243.54
9 Brazil Kati Innot 151 $ 32,087.32
13 Brazil Tobin Roselli 211 $ 31,997.93
<ipython-input-20-3742e15cb0db>:13: FutureWarning: Indexing with multiple keys (implicitly converted to a tuple of keys) will be deprecated, use a list instead.
df11=df11.groupby(['country_name']+ ['seller_name'])['quantity','total_amount'].sum().reset_index().sort_values(by='total_amount',ascending=False).head()