data = df1.pivot_table("source",rows='enrollment_id',cols="event",aggfunc='count',fill_value=0)
运行上述代码时总是出现TypeError: pivot_table() got an unexpected keyword argument 'rows'的错误。修改办法是rows改成index,cols写成全名”columns”
data = df1.pivot_table("source",index='enrollment_id',columns="event",aggfunc='count',fill_value=0)
我是一只不会南飞的燕!大家一起学习,一起进步!
网友评论