In [10]: df['counter'] = df.groupby(['Product','SubProd']).cumcount()+1In [11]: dfOut[11]: Product SubProd counter4/20/2012 A BL 14/27/2012 A BL 25/4/2012 A BL 35/11/2012 A BL 45/18/2012 A BL 54/20/2012 A lk 14/27/2012 A lk 25/4/2012 A lk 35/11/2012 A lk 45/18/2012 A lk 55/25/2012 A lk 610/31/2014 B po 111/7/2014 B po 211/14/2014 B po 311/21/2014 B po 411/28/2014 B po 5
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)