Skip to content

Commit

Permalink
Round numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
pvk-developer committed Oct 2, 2024
1 parent dd211ee commit 2a68e1d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/benchmark/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,14 @@ def calculate_support_percentage(df):
feature_columns = df.drop(columns=['dtype', 'sdtype'])
# Calculate percentage of TRUE values for each row (dtype)
percentage_support = feature_columns.mean(axis=1) * 100
return pd.DataFrame({

df = pd.DataFrame({
'dtype': df['dtype'],
'sdtype': df['sdtype'],
'percentage_supported': percentage_support,
})
df['percentage_supported'] = df['percentage_supported'].round(2)
return df


def _version_tuple(version_str):
Expand Down Expand Up @@ -189,7 +192,7 @@ def compare_and_store_results_in_gdrive():
else:
summary[name] = df['percentage_supported']

summary['average'] = summary[list(results)].mean(axis=1)
summary['average'] = summary[list(results)].mean(axis=1).round(2)
for col in summary.columns:
if col not in ('sdtype', 'dtype'):
summary[col] = summary[col].apply(lambda x: f'{x}%')
Expand Down

0 comments on commit 2a68e1d

Please sign in to comment.