利用python进行数据分析
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')