diff options
author | Pacien TRAN-GIRARD | 2014-10-25 13:58:25 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2014-10-25 13:58:25 +0200 |
commit | 751dff374f14fe995d8864523be789420f71e02e (patch) | |
tree | 10636d01b84f136b8d47cb6d1dbfc82142e8178f /main.py | |
parent | 32497cb9f54f1a2783ca9334dc2b6432d8135fc4 (diff) | |
download | wikistats-751dff374f14fe995d8864523be789420f71e02e.tar.gz |
Properly calculate ban duration in months instead of days
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -49,8 +49,7 @@ ban_db_wrapper = BanDBWrapper(ban_db) | |||
49 | # HISTOGRAM | 49 | # HISTOGRAM |
50 | 50 | ||
51 | ban_durations = ban_db_wrapper.get_all_durations() | 51 | ban_durations = ban_db_wrapper.get_all_durations() |
52 | duration_bins = [round(365 / 12 * x) for x in range(1, 50 + 2)] | 52 | (ban_durations_bars, bins) = np.histogram(ban_durations, bins=range(1, 50 + 2)) |
53 | (ban_durations_bars, bins) = np.histogram(ban_durations, bins=duration_bins) | ||
54 | 53 | ||
55 | bar_chart = pygal.Bar(legend_at_bottom=True) | 54 | bar_chart = pygal.Bar(legend_at_bottom=True) |
56 | bar_chart.title = "Active Wikipedia bans by duration (%d samples)" % len(ban_db.list()) | 55 | bar_chart.title = "Active Wikipedia bans by duration (%d samples)" % len(ban_db.list()) |