Pandas Mappin ID bernilai di baris yang berbeda

df.drop('Element', axis=1)\
  .query('Name != "" ')\
  .assign(E_count = df['ID'].map(df['Element'].value_counts()))
Ramon Ljevo