[英]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.