From abdf0952b024943432765bb210f4e7c8cd73ed7e Mon Sep 17 00:00:00 2001 From: Sebastien Plante Date: Mon, 29 May 2023 12:57:49 -0400 Subject: [PATCH] Update 'videotron1.py' adding total of users --- videotron1.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/videotron1.py b/videotron1.py index e67549a..1c58d88 100644 --- a/videotron1.py +++ b/videotron1.py @@ -51,6 +51,8 @@ while True: datasum = df.groupby('USER')['DATA'].sum( min_count=1).reset_index().sort_values(by='DATA') + total_users = len(datasum) # Nombre total d'utilisateurs + for index, row in datasum.iterrows(): total_data = round(row['DATA']) user = row['USER'] @@ -71,4 +73,5 @@ while True: else: total_data_text = "{} KB".format(total_data) - print("Total Data Usage:", total_data_text) + print("Total Users : {} \t Total Data Usage: {}".format( + total_users, total_data_text))