성동1기 전Z전능 데이터 분석가 과정

[성동1기 전Z전능 데이터 분석가] 52일차 파이널 프로젝트

데이터분석가_안졍 2024. 1. 4. 12:32
728x90

출고량 예측 분석하기
- 데이터 불러오기 및 합치기

 

import pandas as pd
import numpy as np
import seaborn as sns
destination = pd.read_csv('destination.csv')
product = pd.read_csv('product.csv')
center = pd.read_csv('center.csv')
delivery = pd.read_csv('delivery.csv', parse_dates = ['ship_time']) # ship_time이 object 형식으로 나오기 때문에

 

필요한 것만 정리하기

delivery_1 = delivery[['ship_time', 'center_code', 'region', 'qt', 'box_qt', 'unit_qt', 'product_code', 'destination_code']]
product_1 = product[['ship_unit', 'ship_unit_qt', 'std_weight', 'condition', 'remark1', 'remark2', 'cbm', 'product_code', 'customer_code']]
center_1 = center[['center_code', 'func']]
destination_1 = destination[['destination_code', 'address']]
destination_1 = destination_1.drop_duplicates()customer_code

 

합치기

RT = pd.merge(delivery_1, product_1, how = 'left', on = 'product_code')
RT_ver1 = pd.merge(RT, center_1, how = 'left', on = 'center_code')
RT_ver2 = pd.merge(RT_ver1, destination_1, how = 'left', on = 'destination_code')