pivot_table() got an unexpected keyword argument 'rows'

TypeError: pivot_table() got an unexpected keyword argument 'rows'

在学习《利用Python进行数据分析》的第二章MovieLens 1M数据集时遇到了一个报错

pivot_table() got an unexpected keyword argument 'rows'

在python3.5上的执行结果

 

在Python3.5的pivot_table中需要用

inedxcolumns分别代表rowscols,即inder=rows,columns=cols

修改后执行结果如下:pivot_table() got an unexpected keyword argument 'rows'