mirror of
https://github.com/StefBuwalda/whatsapp-wordcloud.git
synced 2025-10-30 03:09:58 +00:00
setting up the data to generate a piechart
This commit is contained in:
12
piechart.py
Normal file
12
piechart.py
Normal 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}%)",
|
||||
)
|
||||
Reference in New Issue
Block a user