kopia lustrzana https://github.com/mkdryden/telegram-stats-bot
stats: Add total row to get_stats_type output
rodzic
4815fd7d79
commit
0734ca9248
|
@ -706,6 +706,9 @@ class StatsRunner(object):
|
|||
df_u.columns = ['type', 'User Count', 'User Percent']
|
||||
|
||||
df = df.merge(df_u, on="type", how="outer")
|
||||
|
||||
a = list(zip(df.columns.values, ["Total"] + df.iloc[:, 1:].sum().to_list()))
|
||||
df = df.append({key: value for key, value in a}, ignore_index=True)
|
||||
text = df.to_string(index=False, header=True, float_format=lambda x: f"{x:.1f}")
|
||||
|
||||
if user:
|
||||
|
|
Ładowanie…
Reference in New Issue