【发布时间】:2022-01-11 12:20:01
【问题描述】:
我想创建一个列表,该列表计算数据帧中每个相同行的零迭代次数。
Id_1 Id_2
0 1401 1
1 1401 1
2 1801 0
3 1801 0
4 1801 0
5 1801 0
6 2001 1
7 2001 1
8 2201 0
9 2201 0
# I would like this output:
L = [(1801, 4), (2201, 2)]
【问题讨论】:
标签: python python-3.x pandas list dataframe