美文网首页
无标题文章

无标题文章

作者: 一杯乌龙茶 | 来源:发表于2017-10-10 16:36 被阅读0次

    利用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')

    相关文章

      网友评论

          本文标题:无标题文章

          本文链接:https://www.haomeiwen.com/subject/xkxbyxtx.html