</pre><span style="font-size:18px">1.<span style="color:rgb(85,85,85); font-family:'microsoft yahei'; line-height:35px">学习《利用</span><a target=_blank target="_blank" href="http://lib.youkuaiyun.com/base/python" class="replace_word" title="Python知识库" style="text-decoration:none; color:rgb(223,52,52); font-family:'microsoft yahei'; line-height:35px; font-weight:bold">Python</a><span style="color:rgb(85,85,85); font-family:'microsoft yahei'; line-height:35px">进行数据分析》第二章的时候,处理1880-2010年间全美婴儿姓名数据,有句代码总是报错:</span></span><p></p><pre name="code" class="python">total_births = names.pivot_table('births', rows='year', cl=ols = 'sex', aggfunc = sum)
报错信息如下:
TypeError: pivot_table() got an unexpected keyword argument 'rows'
解决方法,将代码改为