lunarflu HF staff commited on
Commit
7be2917
1 Parent(s): 9f6b822

debug rank

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -319,19 +319,25 @@ async def add_exp(member_id):
319
  print("test6")
320
  current_role = lvls[current_level]
321
  if current_role not in member.roles: # if we need to level up / update role
322
-
323
  # finding leaderboard rank + excluding huggingfolks (still need exclusion)
324
  try:
325
  # cell_value = L1234567890L
326
  # make copy
327
  # remove L
328
  # do calculations
 
329
  copy_df = global_df.copy()
 
330
  copy_df['discord_user_id'] = copy_df['discord_user_id'].str.strip('L').astype(str)
 
331
  copy_df['total_exp'] = copy_df['total_exp'].str.strip('L').astype(int)
 
332
  row = copy_df[copy_df['discord_user_id'] == str(member_id)]
 
333
  print(f"Row found for {member_id}!")
334
  target_exp = row['total_exp'].values[0]
 
335
  rank = (copy_df['total_exp'] > target_exp).sum() + 1
336
  print(f"The rank for discord_id {member_id} based on total_exp is: {rank}")
337
  except Exception as e:
 
319
  print("test6")
320
  current_role = lvls[current_level]
321
  if current_role not in member.roles: # if we need to level up / update role
322
+ print("test7")
323
  # finding leaderboard rank + excluding huggingfolks (still need exclusion)
324
  try:
325
  # cell_value = L1234567890L
326
  # make copy
327
  # remove L
328
  # do calculations
329
+ print("test8")
330
  copy_df = global_df.copy()
331
+ print("test9")
332
  copy_df['discord_user_id'] = copy_df['discord_user_id'].str.strip('L').astype(str)
333
+ print("test10")
334
  copy_df['total_exp'] = copy_df['total_exp'].str.strip('L').astype(int)
335
+ print("test11")
336
  row = copy_df[copy_df['discord_user_id'] == str(member_id)]
337
+ print("test12")
338
  print(f"Row found for {member_id}!")
339
  target_exp = row['total_exp'].values[0]
340
+ print("test13")
341
  rank = (copy_df['total_exp'] > target_exp).sum() + 1
342
  print(f"The rank for discord_id {member_id} based on total_exp is: {rank}")
343
  except Exception as e: