setting up the data to generate a piechart

This commit is contained in:
2025-04-18 18:21:50 +02:00
parent e7cfc81146
commit 2bf664e25f
4 changed files with 27 additions and 8 deletions

12
piechart.py Normal file
View File

@@ -0,0 +1,12 @@
from backend.process_data import (
total_frequency_dict as freq_dict,
total_frequency as total,
)
for author in freq_dict:
fraction = round(freq_dict[author] / total * 100, 1)
print(
f"{author + ":":<30}",
f"{str(freq_dict.get(author))+"/"+str(total):>15}",
f"({fraction:>4}%)",
)