我在python从pd.concat来与重复多指标一个大熊猫数据帧的重复多指标:重置熊猫
customer_id
0 0 46841769
1 4683936
1 0 8880872
1 8880812
0 0 8880873
1 1000521
1 0 1135488
1 5388773
否,我将重置仅多指标的第一索引,以使得我在索引上得到一个重复的数字。事情是这样的:
customer_id
0 0 46841769
1 4683936
1 0 8880872
1 8880812
2 0 8880873
1 1000521
3 0 1135488
1 5388773
一般情况下,我有大约5神达记录,而不是最大的机器。所以我正在寻找一个高效的内存解决方案。
ignore_index =在pd.concat中为true不起作用,因为那时我失去了Multiindex。
非常感谢
你的'concat'代码是什么? – jezrael