Answers for "create a colun in pandas using groupby"

0

create a colun in pandas using groupby

In [13]: df.groupby(["item", "color"])["id"].transform("count")
Out[13]:
0    2
1    2
2    2
3    1
4    2
dtype: int64
Posted by: Guest on August-11-2021

Code answers related to "create a colun in pandas using groupby"

Python Answers by Framework

Browse Popular Code Answers by Language