Update 'videotron1.py'
adding total of users
This commit is contained in:
@@ -51,6 +51,8 @@ while True:
|
|||||||
datasum = df.groupby('USER')['DATA'].sum(
|
datasum = df.groupby('USER')['DATA'].sum(
|
||||||
min_count=1).reset_index().sort_values(by='DATA')
|
min_count=1).reset_index().sort_values(by='DATA')
|
||||||
|
|
||||||
|
total_users = len(datasum) # Nombre total d'utilisateurs
|
||||||
|
|
||||||
for index, row in datasum.iterrows():
|
for index, row in datasum.iterrows():
|
||||||
total_data = round(row['DATA'])
|
total_data = round(row['DATA'])
|
||||||
user = row['USER']
|
user = row['USER']
|
||||||
@@ -71,4 +73,5 @@ while True:
|
|||||||
else:
|
else:
|
||||||
total_data_text = "{} KB".format(total_data)
|
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))
|
||||||
|
|||||||
Reference in New Issue
Block a user