利用python进行数据分析 第二章错误
其中有一段代码:
mean_ratings = data.pivot_table('rating', rows='title', cols='gender', aggfunc='mean')
始终无法运行,报错:
TypeError: pivot_table() got an unexpected keyword argument 'rows'
经测试,改为:
mean_ratings = data.pivot_table('rating', index='title', colums='gender', aggfunc='mean')
可以成功运行