Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -274,8 +274,12 @@ def get_all_df_i2v(selected_columns, dir=I2V_DIR):
|
|
| 274 |
|
| 275 |
def convert_scores_to_percentage(df):
|
| 276 |
# 对DataFrame中的每一列(除了'name'列)进行操作
|
| 277 |
-
|
| 278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 279 |
df[column] = round(df[column] * 100,2) # 将分数转换为百分数
|
| 280 |
df[column] = df[column].astype(str) + '%'
|
| 281 |
return df
|
|
|
|
| 274 |
|
| 275 |
def convert_scores_to_percentage(df):
|
| 276 |
# 对DataFrame中的每一列(除了'name'列)进行操作
|
| 277 |
+
|
| 278 |
+
if 'Source' in df.columns:
|
| 279 |
+
skip_col =2
|
| 280 |
+
else:
|
| 281 |
+
skip_col =1
|
| 282 |
+
for column in df.columns[skip_col:]: # 假设第一列是'name'
|
| 283 |
df[column] = round(df[column] * 100,2) # 将分数转换为百分数
|
| 284 |
df[column] = df[column].astype(str) + '%'
|
| 285 |
return df
|