sergiopaniego HF Staff commited on
Commit
308c2ce
·
verified ·
1 Parent(s): 2d4af6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -58,7 +58,13 @@ df_main = df_orig.select(
58
  )
59
 
60
  df_main = df_main.with_columns(
61
- [pl.col(col).fill_null(0).cast(pl.Int64).alias(col) for col in ["upvotes", "num_comments"]]
 
 
 
 
 
 
62
  )
63
 
64
  df_main = df_main.rename(
 
58
  )
59
 
60
  df_main = df_main.with_columns(
61
+ [
62
+ pl.when(pl.col(col) == "").then(None).otherwise(pl.col(col))
63
+ .cast(pl.Int64)
64
+ .fill_null(0)
65
+ .alias(col)
66
+ for col in ["upvotes", "num_comments"]
67
+ ]
68
  )
69
 
70
  df_main = df_main.rename(