Faster alternatives to Pandas pivot_table

前端 未结 3 1025
隐瞒了意图╮
隐瞒了意图╮ 2021-02-11 09:33

I\'m using Pandas pivot_table function on a large dataset (10 million rows, 6 columns). As execution time is paramount, I try to speed up the process. Currently it

3条回答
  •  情歌与酒
    2021-02-11 10:14

    Convert the columns months and industry to categorical columns: https://pandas.pydata.org/pandas-docs/stable/user_guide/categorical.html This way you avoid a lot of string comparisons.

提交回复
热议问题