Update app.py
Browse files
app.py
CHANGED
@@ -519,7 +519,7 @@ def server(input, output, session):
|
|
519 |
# Step 2: Format the columns with (value (+diff)) - exclude brackets if diff is 80
|
520 |
df_merge = df_merge.with_columns([
|
521 |
pl.when(pl.col(new + "_diff").eq(10000)) # If diff is 80, no need to include brackets
|
522 |
-
.then(pl.col(new) * 100).round(1).cast(pl.Utf8)+'\n\t') # Just return the new value as string
|
523 |
.otherwise(
|
524 |
(pl.col(new) * 100).round(1).map_elements(lambda x: f"{x:.1f}%").cast(pl.Utf8) +
|
525 |
"\n(" +
|
|
|
519 |
# Step 2: Format the columns with (value (+diff)) - exclude brackets if diff is 80
|
520 |
df_merge = df_merge.with_columns([
|
521 |
pl.when(pl.col(new + "_diff").eq(10000)) # If diff is 80, no need to include brackets
|
522 |
+
.then((pl.col(new) * 100).round(1).cast(pl.Utf8)+'\n\t') # Just return the new value as string
|
523 |
.otherwise(
|
524 |
(pl.col(new) * 100).round(1).map_elements(lambda x: f"{x:.1f}%").cast(pl.Utf8) +
|
525 |
"\n(" +
|