IAMJB commited on
Commit
5d178cc
·
1 Parent(s): 8a69ac8

fix num ressource

Browse files
Files changed (1) hide show
  1. df/PaperCentral.py +9 -0
df/PaperCentral.py CHANGED
@@ -410,16 +410,25 @@ class PaperCentral:
410
  if "datasets" in hf_options:
411
  if 'num_datasets' not in columns_to_show:
412
  columns_to_show.append('num_datasets')
 
 
 
413
  filtered_df = filtered_df[filtered_df['num_datasets'] != 0]
414
 
415
  if "models" in hf_options:
416
  if 'num_models' not in columns_to_show:
417
  columns_to_show.append('num_models')
 
 
 
418
  filtered_df = filtered_df[filtered_df['num_models'] != 0]
419
 
420
  if "spaces" in hf_options:
421
  if 'num_spaces' not in columns_to_show:
422
  columns_to_show.append('num_spaces')
 
 
 
423
  filtered_df = filtered_df[filtered_df['num_spaces'] != 0]
424
 
425
  if "github" in hf_options:
 
410
  if "datasets" in hf_options:
411
  if 'num_datasets' not in columns_to_show:
412
  columns_to_show.append('num_datasets')
413
+ # Convert to integer, handling possible non-numeric values
414
+ filtered_df['num_datasets'] = pd.to_numeric(filtered_df['num_datasets'], errors='coerce').fillna(
415
+ 0).astype(int)
416
  filtered_df = filtered_df[filtered_df['num_datasets'] != 0]
417
 
418
  if "models" in hf_options:
419
  if 'num_models' not in columns_to_show:
420
  columns_to_show.append('num_models')
421
+ # Convert to integer, handling possible non-numeric values
422
+ filtered_df['num_models'] = pd.to_numeric(filtered_df['num_models'], errors='coerce').fillna(0).astype(
423
+ int)
424
  filtered_df = filtered_df[filtered_df['num_models'] != 0]
425
 
426
  if "spaces" in hf_options:
427
  if 'num_spaces' not in columns_to_show:
428
  columns_to_show.append('num_spaces')
429
+ # Convert to integer, handling possible non-numeric values
430
+ filtered_df['num_spaces'] = pd.to_numeric(filtered_df['num_spaces'], errors='coerce').fillna(0).astype(
431
+ int)
432
  filtered_df = filtered_df[filtered_df['num_spaces'] != 0]
433
 
434
  if "github" in hf_options: