PANDAS: int32 overflow? Can't bulid a pivot table

前端 未结 4 601
醉酒成梦
醉酒成梦 2021-01-19 09:50

I use the pd.pivot_table() method to create a user-item matrix by pivoting the user-item activity data. However, the dataframe is so large that I got compla

4条回答
  •  北海茫月
    2021-01-19 10:15

    You can use groupby instead. Try this code:

    reviews.groupby(['userId','movieId'])['rating'].max().unstack()
    

提交回复
热议问题