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

前端 未结 4 599
醉酒成梦
醉酒成梦 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 09:57

    Some Solutions:

    • You can downgrade your pandas version to 0.21 which is no problem with pivot table with big size datas.
    • You can set your data to dictionary format like df.groupby('EVENT_ID')['DIAGNOSIS'].apply(list).to_dict()

提交回复
热议问题