Skip to content

Commit

Permalink
Show percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomsch committed Dec 10, 2023
1 parent a0239b2 commit 572a47c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/python/main/analysis/print_tangled_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ def format_for_latex(dataframe: pd.DataFrame) -> pd.DataFrame:
- Reshape the dataframe
- Use human friendly names for the indices, columns and values
"""

# Format 'count' column to be a percentage
dataframe['count'] = dataframe['count'].map(lambda x: f"{x:.0%}")

# Reshape the dataframe
dataframe = dataframe.pivot(columns='dataset', index='tangled_metric',values='count').reset_index().rename_axis(None, axis=1)

Expand Down

0 comments on commit 572a47c

Please sign in to comment.