Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -372,7 +372,7 @@ def get_final_score_i2v(df, selected_columns):
|
|
372 |
df.insert(1, 'Selected Score', selected_score)
|
373 |
# df.loc[df[9:].isnull().any(axis=1), ['Total Score', 'I2V Score']] = 'N.A.'
|
374 |
mask = df.iloc[:, 8:].isnull().any(axis=1)
|
375 |
-
df.loc[mask, ['Total Score', 'I2V Score']] =
|
376 |
# df.fillna('N.A.', inplace=True)
|
377 |
return df
|
378 |
|
@@ -494,7 +494,7 @@ def convert_scores_to_percentage(df):
|
|
494 |
valid_numeric_count = pd.to_numeric(df[column], errors='coerce').notna().sum()
|
495 |
if valid_numeric_count > 0:
|
496 |
df[column] = round(df[column] * 100,2)
|
497 |
-
df[column] = df[column].apply(lambda x: f"{x:05.2f}%" if pd.notna(pd.to_numeric(x, errors='coerce'))
|
498 |
# df[column] = df[column].apply(lambda x: f"{x:05.2f}") + '%'
|
499 |
return df
|
500 |
|
|
|
372 |
df.insert(1, 'Selected Score', selected_score)
|
373 |
# df.loc[df[9:].isnull().any(axis=1), ['Total Score', 'I2V Score']] = 'N.A.'
|
374 |
mask = df.iloc[:, 8:].isnull().any(axis=1)
|
375 |
+
df.loc[mask, ['Total Score', 'I2V Score']] = np.nan
|
376 |
# df.fillna('N.A.', inplace=True)
|
377 |
return df
|
378 |
|
|
|
494 |
valid_numeric_count = pd.to_numeric(df[column], errors='coerce').notna().sum()
|
495 |
if valid_numeric_count > 0:
|
496 |
df[column] = round(df[column] * 100,2)
|
497 |
+
df[column] = df[column].apply(lambda x: f"{x:05.2f}%" if pd.notna(pd.to_numeric(x, errors='coerce')) else x)
|
498 |
# df[column] = df[column].apply(lambda x: f"{x:05.2f}") + '%'
|
499 |
return df
|
500 |
|