import pandas as pd
[ ]:
retail = pd.read_csv('/content/drive/MyDrive/KDT/5.데이터 분석/데이터/OnlineRetail.csv')
retail
[2]:
InvoiceNoStockCodeDescriptionQuantityInvoiceDateUnitPriceCustomerIDCountry01234...541904541905541906541907541908
536365 | 85123A | WHITE HANGING HEART T-LIGHT HOLDER | 6 | 12/1/2010 8:26 | 2.55 | 17850.0 | United Kingdom |
536365 | 71053 | WHITE METAL LANTERN | 6 | 12/1/2010 8:26 | 3.39 | 17850.0 | United Kingdom |
536365 | 84406B | CREAM CUPID HEARTS COAT HANGER | 8 | 12/1/2010 8:26 | 2.75 | 17850.0 | United Kingdom |
536365 | 84029G | KNITTED UNION FLAG HOT WATER BOTTLE | 6 | 12/1/2010 8:26 | 3.39 | 17850.0 | United Kingdom |
536365 | 84029E | RED WOOLLY HOTTIE WHITE HEART. | 6 | 12/1/2010 8:26 | 3.39 | 17850.0 | United Kingdom |
... | ... | ... | ... | ... | ... | ... | ... |
581587 | 22613 | PACK OF 20 SPACEBOY NAPKINS | 12 | 12/9/2011 12:50 | 0.85 | 12680.0 | France |
581587 | 22899 | CHILDREN'S APRON DOLLY GIRL | 6 | 12/9/2011 12:50 | 2.10 | 12680.0 | France |
581587 | 23254 | CHILDRENS CUTLERY DOLLY GIRL | 4 | 12/9/2011 12:50 | 4.15 | 12680.0 | France |
581587 | 23255 | CHILDRENS CUTLERY CIRCUS PARADE | 4 | 12/9/2011 12:50 | 4.15 | 12680.0 | France |
581587 | 22138 | BAKING SET 9 PIECE RETROSPOT | 3 | 12/9/2011 12:50 | 4.95 | 12680.0 | France |
541909 rows × 8 columns
[ ]:
retail.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 541909 entries, 0 to 541908
Data columns (total 8 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 InvoiceNo 541909 non-null object
1 StockCode 541909 non-null object
2 Description 540455 non-null object
3 Quantity 541909 non-null int64
4 InvoiceDate 541909 non-null object
5 UnitPrice 541909 non-null float64
6 CustomerID 406829 non-null float64
7 Country 541909 non-null object
dtypes: float64(2), int64(1), object(5)
memory usage: 33.1+ MB
컬럼
- InvoiceNo: 주문 번호
- StockCode: 상품 코드
- Description: 상품 설명
- Quantity: 주문 수량
- InvoiceDate: 주문 날짜
- UnitPrice: 상품 가격
- CustomerID: 고객 아이디
- Country: 고객 거주지역(국가)
[ ]:
# 각 컬럼당 null이 몇 개 있는지 확인
retail.isnull().sum()
[4]:
InvoiceNo 0
StockCode 0
Description 1454
Quantity 0
InvoiceDate 0
UnitPrice 0
CustomerID 135080
Country 0
dtype: int64
[ ]:
# 비회원/탈퇴/휴면회원 제거
retail= retail[pd.notnull(retail['CustomerID'])]
len(retail)
[5]:
406829
[ ]:
retail.describe()
[6]:
QuantityUnitPriceCustomerIDcountmeanstdmin25%50%75%max
406829.000000 | 406829.000000 | 406829.000000 |
12.061303 | 3.460471 | 15287.690570 |
248.693370 | 69.315162 | 1713.600303 |
-80995.000000 | 0.000000 | 12346.000000 |
2.000000 | 1.250000 | 13953.000000 |
5.000000 | 1.950000 | 15152.000000 |
12.000000 | 3.750000 | 16791.000000 |
80995.000000 | 38970.000000 | 18287.000000 |
[ ]:
# 구입 수량이 0 또는 0이하인 데이터를 확인
retail[retail['Quantity'] <= 0]
[7]:
InvoiceNoStockCodeDescriptionQuantityInvoiceDateUnitPriceCustomerIDCountry141154235236237...540449541541541715541716541717
C536379 | D | Discount | -1 | 12/1/2010 9:41 | 27.50 | 14527.0 | United Kingdom |
C536383 | 35004C | SET OF 3 COLOURED FLYING DUCKS | -1 | 12/1/2010 9:49 | 4.65 | 15311.0 | United Kingdom |
C536391 | 22556 | PLASTERS IN TIN CIRCUS PARADE | -12 | 12/1/2010 10:24 | 1.65 | 17548.0 | United Kingdom |
C536391 | 21984 | PACK OF 12 PINK PAISLEY TISSUES | -24 | 12/1/2010 10:24 | 0.29 | 17548.0 | United Kingdom |
C536391 | 21983 | PACK OF 12 BLUE PAISLEY TISSUES | -24 | 12/1/2010 10:24 | 0.29 | 17548.0 | United Kingdom |
... | ... | ... | ... | ... | ... | ... | ... |
C581490 | 23144 | ZINC T-LIGHT HOLDER STARS SMALL | -11 | 12/9/2011 9:57 | 0.83 | 14397.0 | United Kingdom |
C581499 | M | Manual | -1 | 12/9/2011 10:28 | 224.69 | 15498.0 | United Kingdom |
C581568 | 21258 | VICTORIAN SEWING BOX LARGE | -5 | 12/9/2011 11:57 | 10.95 | 15311.0 | United Kingdom |
C581569 | 84978 | HANGING HEART JAR T-LIGHT HOLDER | -1 | 12/9/2011 11:58 | 1.25 | 17315.0 | United Kingdom |
C581569 | 20979 | 36 PENCILS TUBE RED RETROSPOT | -5 | 12/9/2011 11:58 | 1.25 | 17315.0 | United Kingdom |
8905 rows × 8 columns
[ ]:
# 구입 수량이 1이상인 데이터만 저장
retail = retail[retail['Quantity'] >= 1]
[ ]:
len(retail)
[9]:
397924
[ ]:
# 구입 가격이 0 또는 0이하인 데이터를 확인
retail[retail['UnitPrice'] <= 0]
[10]:
InvoiceNoStockCodeDescriptionQuantityInvoiceDateUnitPriceCustomerIDCountry9302335764008947068470705667486789130188139453145208157042187613198383279324282912285657298054314745314746314747314748358655361825379913395529420404436428436597436961439361446125446793446794454463454464479079479546480649485985502122
537197 | 22841 | ROUND CAKE TIN VINTAGE GREEN | 1 | 12/5/2010 14:02 | 0.0 | 12647.0 | Germany |
539263 | 22580 | ADVENT CALENDAR GINGHAM SACK | 4 | 12/16/2010 14:36 | 0.0 | 16560.0 | United Kingdom |
539722 | 22423 | REGENCY CAKESTAND 3 TIER | 10 | 12/21/2010 13:45 | 0.0 | 14911.0 | EIRE |
540372 | 22090 | PAPER BUNTING RETROSPOT | 24 | 1/6/2011 16:41 | 0.0 | 13081.0 | United Kingdom |
540372 | 22553 | PLASTERS IN TIN SKULLS | 24 | 1/6/2011 16:41 | 0.0 | 13081.0 | United Kingdom |
541109 | 22168 | ORGANISER WOOD ANTIQUE WHITE | 1 | 1/13/2011 15:10 | 0.0 | 15107.0 | United Kingdom |
543599 | 84535B | FAIRY CAKES NOTEBOOK A6 SIZE | 16 | 2/10/2011 13:08 | 0.0 | 17560.0 | United Kingdom |
547417 | 22062 | CERAMIC BOWL WITH LOVE HEART DESIGN | 36 | 3/23/2011 10:25 | 0.0 | 13239.0 | United Kingdom |
548318 | 22055 | MINI CAKE STAND HANGING STRAWBERY | 5 | 3/30/2011 12:45 | 0.0 | 13113.0 | United Kingdom |
548871 | 22162 | HEART GARLAND RUSTIC PADDED | 2 | 4/4/2011 14:42 | 0.0 | 14410.0 | United Kingdom |
550188 | 22636 | CHILDS BREAKFAST SET CIRCUS PARADE | 1 | 4/14/2011 18:57 | 0.0 | 12457.0 | Switzerland |
553000 | 47566 | PARTY BUNTING | 4 | 5/12/2011 15:21 | 0.0 | 17667.0 | United Kingdom |
554037 | 22619 | SET OF 6 SOLDIER SKITTLES | 80 | 5/20/2011 14:13 | 0.0 | 12415.0 | Australia |
561284 | 22167 | OVAL WALL MIRROR DIAMANTE | 1 | 7/26/2011 12:24 | 0.0 | 16818.0 | United Kingdom |
561669 | 22960 | JAM MAKING SET WITH JARS | 11 | 7/28/2011 17:09 | 0.0 | 12507.0 | Spain |
561916 | M | Manual | 1 | 8/1/2011 11:44 | 0.0 | 15581.0 | United Kingdom |
562973 | 23157 | SET OF 6 NATIVITY MAGNETS | 240 | 8/11/2011 11:42 | 0.0 | 14911.0 | EIRE |
564651 | 23270 | SET OF 2 CERAMIC PAINTED HEARTS | 96 | 8/26/2011 14:19 | 0.0 | 14646.0 | Netherlands |
564651 | 23268 | SET OF 2 CERAMIC CHRISTMAS REINDEER | 192 | 8/26/2011 14:19 | 0.0 | 14646.0 | Netherlands |
564651 | 22955 | 36 FOIL STAR CAKE CASES | 144 | 8/26/2011 14:19 | 0.0 | 14646.0 | Netherlands |
564651 | 21786 | POLKADOT RAIN HAT | 144 | 8/26/2011 14:19 | 0.0 | 14646.0 | Netherlands |
568158 | PADS | PADS TO MATCH ALL CUSHIONS | 1 | 9/25/2011 12:22 | 0.0 | 16133.0 | United Kingdom |
568384 | M | Manual | 1 | 9/27/2011 9:46 | 0.0 | 12748.0 | United Kingdom |
569716 | 22778 | GLASS CLOCHE SMALL | 2 | 10/6/2011 8:17 | 0.0 | 15804.0 | United Kingdom |
571035 | M | Manual | 1 | 10/13/2011 12:50 | 0.0 | 12446.0 | RSA |
572893 | 21208 | PASTEL COLOUR HONEYCOMB FAN | 5 | 10/26/2011 14:36 | 0.0 | 18059.0 | United Kingdom |
574138 | 23234 | BISCUIT TIN VINTAGE CHRISTMAS | 216 | 11/3/2011 11:26 | 0.0 | 12415.0 | Australia |
574175 | 22065 | CHRISTMAS PUDDING TRINKET POT | 12 | 11/3/2011 11:47 | 0.0 | 14110.0 | United Kingdom |
574252 | M | Manual | 1 | 11/3/2011 13:24 | 0.0 | 12437.0 | France |
574469 | 22385 | JUMBO BAG SPACEBOY DESIGN | 12 | 11/4/2011 11:55 | 0.0 | 12431.0 | Australia |
574879 | 22625 | RED KITCHEN SCALES | 2 | 11/7/2011 13:22 | 0.0 | 13014.0 | United Kingdom |
574920 | 22899 | CHILDREN'S APRON DOLLY GIRL | 1 | 11/7/2011 16:34 | 0.0 | 13985.0 | United Kingdom |
574920 | 23480 | MINI LIGHTS WOODLAND MUSHROOMS | 1 | 11/7/2011 16:34 | 0.0 | 13985.0 | United Kingdom |
575579 | 22437 | SET OF 9 BLACK SKULL BALLOONS | 20 | 11/10/2011 11:49 | 0.0 | 13081.0 | United Kingdom |
575579 | 22089 | PAPER BUNTING VINTAGE PAISLEY | 24 | 11/10/2011 11:49 | 0.0 | 13081.0 | United Kingdom |
577129 | 22464 | HANGING METAL HEART LANTERN | 4 | 11/17/2011 19:52 | 0.0 | 15602.0 | United Kingdom |
577168 | M | Manual | 1 | 11/18/2011 10:42 | 0.0 | 12603.0 | Germany |
577314 | 23407 | SET OF 2 TRAYS HOME SWEET HOME | 2 | 11/18/2011 13:23 | 0.0 | 12444.0 | Norway |
577696 | M | Manual | 1 | 11/21/2011 11:57 | 0.0 | 16406.0 | United Kingdom |
578841 | 84826 | ASSTD DESIGN 3D PAPER STICKERS | 12540 | 11/25/2011 15:57 | 0.0 | 13256.0 | United Kingdom |
[ ]:
# 구입 가격이 0초과인 데이터만 저장
retail = retail[retail['UnitPrice'] > 0]
[ ]:
len(retail)
[12]:
397884
[ ]:
# 고객의 총 지출비용 파생변수 만들기
# 총 지출비용(CheckoutPrice) = 가격(UnitPrice) * 수량(Quantity)
retail['CheckoutPrice'] = retail['UnitPrice'] * retail['Quantity']
retail.head()
:3: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
retail['CheckoutPrice'] = retail['UnitPrice'] * retail['Quantity']
[13]:
InvoiceNoStockCodeDescriptionQuantityInvoiceDateUnitPriceCustomerIDCountryCheckoutPrice01234
536365 | 85123A | WHITE HANGING HEART T-LIGHT HOLDER | 6 | 12/1/2010 8:26 | 2.55 | 17850.0 | United Kingdom | 15.30 |
536365 | 71053 | WHITE METAL LANTERN | 6 | 12/1/2010 8:26 | 3.39 | 17850.0 | United Kingdom | 20.34 |
536365 | 84406B | CREAM CUPID HEARTS COAT HANGER | 8 | 12/1/2010 8:26 | 2.75 | 17850.0 | United Kingdom | 22.00 |
536365 | 84029G | KNITTED UNION FLAG HOT WATER BOTTLE | 6 | 12/1/2010 8:26 | 3.39 | 17850.0 | United Kingdom | 20.34 |
536365 | 84029E | RED WOOLLY HOTTIE WHITE HEART. | 6 | 12/1/2010 8:26 | 3.39 | 17850.0 | United Kingdom | 20.34 |
[ ]:
retail['InvoiceDate'] = pd.to_datetime(retail['InvoiceDate'])
[ ]:
retail.info()
<class 'pandas.core.frame.DataFrame'>
Index: 397884 entries, 0 to 541908
Data columns (total 9 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 InvoiceNo 397884 non-null object
1 StockCode 397884 non-null object
2 Description 397884 non-null object
3 Quantity 397884 non-null int64
4 InvoiceDate 397884 non-null datetime64[ns]
5 UnitPrice 397884 non-null float64
6 CustomerID 397884 non-null float64
7 Country 397884 non-null object
8 CheckoutPrice 397884 non-null float64
dtypes: datetime64[ns](1), float64(3), int64(1), object(4)
memory usage: 30.4+ MB
[ ]:
# 전체 매출
total_revenue = retail['CheckoutPrice'].sum()
[ ]:
# 각 나라별 구매 횟수
# pd.options.display.max_rows = 50
retail.groupby('Country')['InvoiceNo'].count()
[17]:
Country
Australia 1182
Austria 398
Bahrain 17
Belgium 2031
Brazil 32
Canada 151
Channel Islands 748
Cyprus 614
Czech Republic 25
Denmark 380
EIRE 7236
European Community 60
Finland 685
France 8341
Germany 9040
Greece 145
Iceland 182
Israel 248
Italy 758
Japan 321
Lebanon 45
Lithuania 35
Malta 112
Netherlands 2359
Norway 1071
Poland 330
Portugal 1462
RSA 57
Saudi Arabia 9
Singapore 222
Spain 2484
Sweden 451
Switzerland 1841
USA 179
United Arab Emirates 68
United Kingdom 354321
Unspecified 244
Name: InvoiceNo, dtype: int64
[ ]:
# 국가별 매출
retail.groupby('Country')['CheckoutPrice'].sum().sort_values()
[18]:
Country
Saudi Arabia 145.920
Bahrain 548.400
Czech Republic 826.740
RSA 1002.310
Brazil 1143.600
European Community 1300.250
Lithuania 1661.060
Lebanon 1693.880
United Arab Emirates 1902.280
Unspecified 2667.070
Malta 2725.590
USA 3580.390
Canada 3666.380
Iceland 4310.000
Greece 4760.520
Israel 7221.690
Poland 7334.650
Austria 10198.680
Cyprus 13590.380
Italy 17483.240
Denmark 18955.340
Channel Islands 20450.440
Singapore 21279.290
Finland 22546.080
Portugal 33439.890
Norway 36165.440
Japan 37416.370
Sweden 38378.330
Belgium 41196.340
Switzerland 56443.950
Spain 61577.110
Australia 138521.310
France 209024.050
Germany 228867.140
EIRE 265545.900
Netherlands 285446.340
United Kingdom 7308391.554
Name: CheckoutPrice, dtype: float64
[ ]:
# 국가별 매출에 따른 막대 그래프
import matplotlib.pyplot as plt
[ ]:
country_sales = retail.groupby('Country')['CheckoutPrice'].sum()
country_sales = country_sales.sort_values()
plt.figure(figsize=(10,10))
plt.barh(country_sales.index, country_sales.values)
plt.xlabel("Country")
plt.ylabel("CheckoutPrice")
plt.title("Country_CheckoutPrice")
plt.show()

[ ]:
plot = country_sales.plot(kind='bar', figsize=(20, 10))
plot.set_xlabel('Contry', fontsize=12)
plot.set_ylabel('Revenue', fontsize=12)
plot.set_title('Revenue By Country', fontsize=15)
plot.set_xticklabels(labels=country_sales.index, rotation=45)
[21]:
[Text(0, 0, 'Saudi Arabia'),
Text(1, 0, 'Bahrain'),
Text(2, 0, 'Czech Republic'),
Text(3, 0, 'RSA'),
Text(4, 0, 'Brazil'),
Text(5, 0, 'European Community'),
Text(6, 0, 'Lithuania'),
Text(7, 0, 'Lebanon'),
Text(8, 0, 'United Arab Emirates'),
Text(9, 0, 'Unspecified'),
Text(10, 0, 'Malta'),
Text(11, 0, 'USA'),
Text(12, 0, 'Canada'),
Text(13, 0, 'Iceland'),
Text(14, 0, 'Greece'),
Text(15, 0, 'Israel'),
Text(16, 0, 'Poland'),
Text(17, 0, 'Austria'),
Text(18, 0, 'Cyprus'),
Text(19, 0, 'Italy'),
Text(20, 0, 'Denmark'),
Text(21, 0, 'Channel Islands'),
Text(22, 0, 'Singapore'),
Text(23, 0, 'Finland'),
Text(24, 0, 'Portugal'),
Text(25, 0, 'Norway'),
Text(26, 0, 'Japan'),
Text(27, 0, 'Sweden'),
Text(28, 0, 'Belgium'),
Text(29, 0, 'Switzerland'),
Text(30, 0, 'Spain'),
Text(31, 0, 'Australia'),
Text(32, 0, 'France'),
Text(33, 0, 'Germany'),
Text(34, 0, 'EIRE'),
Text(35, 0, 'Netherlands'),
Text(36, 0, 'United Kingdom')]
[ ]:
country_sales / total_revenue
[22]:
Country
Saudi Arabia 0.000016
Bahrain 0.000062
Czech Republic 0.000093
RSA 0.000112
Brazil 0.000128
European Community 0.000146
Lithuania 0.000186
Lebanon 0.000190
United Arab Emirates 0.000213
Unspecified 0.000299
Malta 0.000306
USA 0.000402
Canada 0.000411
Iceland 0.000484
Greece 0.000534
Israel 0.000810
Poland 0.000823
Austria 0.001144
Cyprus 0.001525
Italy 0.001962
Denmark 0.002127
Channel Islands 0.002295
Singapore 0.002388
Finland 0.002530
Portugal 0.003752
Norway 0.004058
Japan 0.004199
Sweden 0.004307
Belgium 0.004623
Switzerland 0.006334
Spain 0.006910
Australia 0.015544
France 0.023456
Germany 0.025682
EIRE 0.029798
Netherlands 0.032032
United Kingdom 0.820116
Name: CheckoutPrice, dtype: float64
[ ]:
# 월별 매출 구하기
[ ]:
def extract_month(date):
month = str(date.month)
if date.month < 10:
month = '0' + month
return str(date.year) + month
[ ]:
monthly_sales = retail.groupby(retail['InvoiceDate'].dt.to_period('M'))['CheckoutPrice'].sum()
monthly_sales
[25]:
InvoiceDate
2010-12 572713.890
2011-01 569445.040
2011-02 447137.350
2011-03 595500.760
2011-04 469200.361
2011-05 678594.560
2011-06 661213.690
2011-07 600091.011
2011-08 645343.900
2011-09 952838.382
2011-10 1039318.790
2011-11 1161817.380
2011-12 518192.790
Freq: M, Name: CheckoutPrice, dtype: float64
[ ]:
rev_by_month = retail.set_index('InvoiceDate').groupby(extract_month)['CheckoutPrice'].sum()
[ ]:
def plot_bar(df, xlabel, ylabel, title, titlesize=15, fontsize=12, rotation=45, figsize=(20, 10)):
plot = df.plot(kind='bar', figsize=figsize)
plot.set_xlabel(xlabel, fontsize=fontsize)
plot.set_ylabel(ylabel, fontsize=fontsize)
plot.set_title(title, fontsize=titlesize)
plot.set_xticklabels(labels=df.index, rotation=rotation)
[ ]:
plot_bar(rev_by_month, 'Month', 'Revenue', 'Revenue By Month')
[ ]:
# 요일별 매출 구하기
def extract_dow(date):
return date.dayofweek
[ ]:
# rev_by_dow = retail.set_index('InvoiceDate').groupby(extract_dow)['CheckoutPrice'].sum()
rev_by_dow = retail.set_index('InvoiceDate').groupby(lambda date: date.dayofweek)['CheckoutPrice'].sum()
[ ]:
rev_by_dow
[31]:
InvoiceDate
0 1367146.411
1 1700634.631
2 1588336.170
3 1976859.070
4 1485917.401
6 792514.221
Name: CheckoutPrice, dtype: float64
[ ]:
import numpy as np
[ ]:
DAY_OF_WEEK = np.array(['Mon', 'Tue', 'Web', 'Thur', 'Fri', 'Sat', 'Sun'])
rev_by_dow.index = DAY_OF_WEEK[rev_by_dow.index]
rev_by_dow.index
[33]:
Index(['Mon', 'Tue', 'Web', 'Thur', 'Fri', 'Sun'], dtype='object')
[ ]:
plot_bar(rev_by_dow, 'DOW', 'Revenue', 'Revenue By Dow')
[ ]:
# 시간대별 매출 구하기
rev_by_hour = retail.set_index('InvoiceDate').groupby(lambda date: date.hour)['CheckoutPrice'].sum()
rev_by_hour
[35]:
InvoiceDate
6 4.250
7 31059.210
8 282115.630
9 842605.171
10 1261192.571
11 1104558.750
12 1378571.480
13 1173264.750
14 995629.371
15 966191.750
16 468885.800
17 234413.521
18 104954.430
19 49028.460
20 18932.760
Name: CheckoutPrice, dtype: float64
[ ]:
plot_bar(rev_by_hour, 'Hour', 'Revenue', 'Revenue By Hour')

데이터로부터 Insight
- 전체 매출의 약82%가 UK에서 발생
- 매출은 꾸준히 성장하는 것으로 보임(11년 12월 데이터는 9일까지만 포함)
- 토요일은 영업을 하지 않음
- 새벽 6시에 오픈, 오후 9시에 마감이 예상
- 일주일 중 목요일까지는 성장세를 보이고 이후 하락
문제
- 판매제품(StockCode) Top 10
- 단, 기준은 Quantity
답:
'''
StockCode
23843 80995
23166 77916
84077 54415
22197 49183
85099B 46181
85123A 36782
84879 35362
21212 33693
23084 27202
22492 26076
'''
[ ]:
top_selling = retail.groupby('Quantity')['StockCode'].sum().sort_values(ascending=True)[:10]
top_selling
[37]:
Quantity
48 100022211485183B847552296222963210862217422558...
49 101332257823084
140 1013385099B85099B2181123344
1200 150362244085099B224408421284077224402121215034...
129 16011
41 16011229002139121902M2264251014A2277522419
85 160122278822178
3000 16014
1000 16014160146201821497160142219785099B85099B2219...
1500 160142358222197
Name: StockCode, dtype: object
문제
- 우수 고객(CustomerID) Top 10
- 단 기준은 CheckoutPrice
답:
'''
CustomerID
14646.0 280206.02
18102.0 259657.30
17450.0 194550.79
16446.0 168472.50
14911.0 143825.06
12415.0 124914.53
14156.0 117379.63
17511.0 91062.38
16029.0 81024.84
12346.0 77183.60
'''
'코딩 > 데이터 분석' 카테고리의 다른 글
전국 도시공원 데이터 (0) | 2024.06.07 |
---|---|
상권별 업종 밀집 통계 데이터 (0) | 2024.06.07 |
Matplotlib (1) | 2024.06.07 |
판다스(Pandas) (1) | 2024.06.07 |
넘파이(Numpy) (1) | 2024.06.07 |