데이터 나누기

YongHwan Kim·2023년 4월 26일
0

AICE 시험

목록 보기
3/4

원하는 구간으로 자르기, labels는 bins 보다 1개 작아야한다.

group = pd.cut(data['Age'], bins = [0,40,50,100], labels = ['young', 'junior','senior'])

iloc와 loc 는 다르다.

iloc는 인덱스 추출

합치기

temp.groupby(['Date', 'Category'], as_index = False)['Qty'].sum()

pivot


sort_values

temp2 = pd.merge(temp, stores)
temp2.groupby('State', as_index = False)['Amt'].sum().sort_values('Amt', ascending = False).head(3)
profile
Data Science and Machine Learning

0개의 댓글