Python
Python 데이터 분석(주피터 노트북) - 쇼핑몰(4)_push notification
developers developing
2022. 12. 10. 09:00
쇼핑몰
- UCI ML Repository (https://archive.ics.uci.edu/ml/datasets/Online+Retail#)
- 온라인 리테일 사이트의 2010/12 ~ 2011/12 주문 기록 데이터
- 약 500,000 건 데이터
라이브러리 및 세팅
- import seaborn as sns
- seaborn 폰트 사용 - 한글처리보다 먼저 선언해야함
- sns.set(font_scale=1)
- import pandas as pd
- import matplotlib.pyplot as plt
- 한글처리
- plt.rcParams['font.family'] = 'Malgun Gothic'
- plt.rcParams['axes.unicode_minus'] = False
- 경고 메세지
- import warnings
- warnings.simplefilter("ignore")
- seaborn 스타일의 그래프를 사용
- plt.style.use('seaborn')
- from datetime import datetime
데이터 로드
- 날짜 타입 변경
- 차트 함수

데이터 분석
쿠폰 발송
- 쿠폰 발송 언제할지
- InvoiceDate 이용
1. 시간대별 주문 건수
- order_by_hour

- bar 차트 그리기

2. 30분 단위로 시간 나눈 후 주문 건수
- 함수 생성

- 함수 적용

- order_by_hour_half : 30분 단위 구매 건수

- bar 차트 그리기

3. 점유율
- 30분단위 기준

4. 개인화된 push notification
- 아마존을 필두로 개인화하여 맞춤으로 사용자마다 최적의 솔루션을 찾는 것이 트렌드
1) 사용자별 시간대별 주문량 계산

2) 고객별 가장 많은 건수를 구매한 시간
