lunarflu HF staff commited on
Commit
af299cb
·
verified ·
1 Parent(s): 0b7628c
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -618,14 +618,17 @@ def _remove_huggingfolks_sync(members_with_role):
618
  reorder = ['discord_user_id', 'hf_user_name', 'discord_exp', 'discord_level', 'discord_user_name', 'hub_exp', 'total_exp', 'verified_date']
619
  community_global_df = community_global_df[reorder]
620
 
621
- columns_to_drop = ['discord_user_id', 'discord_exp', 'discord_level', 'discord_user_name', 'hub_exp']
622
- community_global_df.drop(columns=columns_to_drop, inplace=True)
623
-
624
- community_global_df.dropna(subset=['hf_user_name'], inplace=True)
625
-
 
 
 
626
  community_global_df['total_exp'] = community_global_df['total_exp'].str.strip('L').astype(int)
627
  community_global_df['total_exp'] = pd.to_numeric(community_global_df['total_exp'], errors='coerce').fillna(0).astype(int)
628
- community_global_df.sort_values(by='total_exp', ascending=False, inplace=True)
629
 
630
  community_global_df_gradio = community_global_df.copy()
631
  community_global_df_gradio['hf_user_name'] = community_global_df_gradio['hf_user_name'].apply(format_hyperlink)
 
618
  reorder = ['discord_user_id', 'hf_user_name', 'discord_exp', 'discord_level', 'discord_user_name', 'hub_exp', 'total_exp', 'verified_date']
619
  community_global_df = community_global_df[reorder]
620
 
621
+ community_global_df.drop(community_global_df.columns[0], axis=1, inplace=True)
622
+ community_global_df.drop(community_global_df.columns[1], axis=1, inplace=True)
623
+ community_global_df.drop(community_global_df.columns[2], axis=1, inplace=True)
624
+ community_global_df.drop(community_global_df.columns[2], axis=1, inplace=True)
625
+ community_global_df.drop(community_global_df.columns[3], axis=1, inplace=True)
626
+
627
+ # drop rows (records) where hf_user_name does not exist (we display only verified users)
628
+ community_global_df = community_global_df.dropna(subset=['hf_user_name'])
629
  community_global_df['total_exp'] = community_global_df['total_exp'].str.strip('L').astype(int)
630
  community_global_df['total_exp'] = pd.to_numeric(community_global_df['total_exp'], errors='coerce').fillna(0).astype(int)
631
+ community_global_df = community_global_df.nlargest(len(community_global_df), 'total_exp')
632
 
633
  community_global_df_gradio = community_global_df.copy()
634
  community_global_df_gradio['hf_user_name'] = community_global_df_gradio['hf_user_name'].apply(format_hyperlink)