利用python進行數(shù)據分析
p32頁中衰腌,使用pivot_table:
mean_ratings = data.pivot_table('rating',rows = 'title', cols='gender', aggfunc = 'mean')
報錯:TypeError: pivot_table() got an unexpected keyword argument 'rows'
查了有關資料烹棉,將rows改成index玻淑,cols寫成全名”columns”:
mean_ratings = data.pivot_table('rating',index?= 'title', columns='gender', aggfunc = 'mean')