[英]Aggregate Function to dataframe while retaining rows in Pandas
如果您在谈论过滤器,我们应该进行transform
df1['count_col']=df1.groupby(['COLLISION_ID'])['COLLISION_ID'].transform('count')
然后您可以使用列数过滤 df1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.