nesticot commited on
Commit
5b90d07
·
verified ·
1 Parent(s): 7a8d79e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -448,9 +448,11 @@ def server(input, output, session):
448
  }))
449
 
450
  brushed_df_final.with_columns(
451
- pl.when(pl.col("Spin").fill_nan(None).is_not_null())
452
- .then(pl.col("Spin").cast(pl.Float64).round(0))
453
- .otherwise(0)
 
 
454
  .alias("Spin")
455
  )
456
 
 
448
  }))
449
 
450
  brushed_df_final.with_columns(
451
+ pl.col("Spin")
452
+ .cast(pl.Float64, strict=False) # Convert strings to floats, invalid parsing becomes null
453
+ .fill_nan(None) # Convert NaNs to null
454
+ .fill_null(0) # Replace nulls with 0
455
+ .round(0) # Round the valid numeric values
456
  .alias("Spin")
457
  )
458