Pivot Table은 데이터를 원하는 형태로 집계할 때 아주 유용하게 사용할 수 있다.
group by 와 피벗 테이블의 차이를 알아보자.
netflix_df.groupby(['year','genre'])['score'].mean()

pd.pivot_table(netflix_df, values = 'score', index = 'year', columns = 'genre')

aggfunc()
피벗 테이블의 값에 사용할 집계 함수이다.
aggfunc 인자를 생략하면 디폴트 값으로 mean(평균) 함수가 사용