summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2014-10-25 14:00:21 +0200
committerPacien TRAN-GIRARD2014-10-25 14:00:21 +0200
commitccd80beb4d9c7147651864447e7ffe454e64c13f (patch)
treefb8bff320e510e12f8d28ad71c605765494a908d /main.py
parent751dff374f14fe995d8864523be789420f71e02e (diff)
downloadwikistats-ccd80beb4d9c7147651864447e7ffe454e64c13f.tar.gz
Remove useless module aliaswikibania
Diffstat (limited to 'main.py')
-rw-r--r--main.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/main.py b/main.py
index d6ebe3d..8c0f87c 100644
--- a/main.py
+++ b/main.py
@@ -2,7 +2,7 @@ from collections import Counter
2import webbrowser 2import webbrowser
3 3
4import pygal 4import pygal
5import numpy as np 5import numpy
6import pygeoip 6import pygeoip
7 7
8from wikibania.ban.BanDB import BanDB 8from wikibania.ban.BanDB import BanDB
@@ -49,7 +49,7 @@ ban_db_wrapper = BanDBWrapper(ban_db)
49# HISTOGRAM 49# HISTOGRAM
50 50
51ban_durations = ban_db_wrapper.get_all_durations() 51ban_durations = ban_db_wrapper.get_all_durations()
52(ban_durations_bars, bins) = np.histogram(ban_durations, bins=range(1, 50 + 2)) 52(ban_durations_bars, bins) = numpy.histogram(ban_durations, bins=range(1, 50 + 2))
53 53
54bar_chart = pygal.Bar(legend_at_bottom=True) 54bar_chart = pygal.Bar(legend_at_bottom=True)
55bar_chart.title = "Active Wikipedia bans by duration (%d samples)" % len(ban_db.list()) 55bar_chart.title = "Active Wikipedia bans by duration (%d samples)" % len(ban_db.list())
@@ -65,10 +65,10 @@ if OPEN_FILES:
65 65
66with open(STATS_FILE, "w") as stats_file: 66with open(STATS_FILE, "w") as stats_file:
67 stats_file.write("Ban duration:\n") 67 stats_file.write("Ban duration:\n")
68 stats_file.write("Mean: %.2f days\n" % np.mean(ban_durations)) 68 stats_file.write("Mean: %.2f days\n" % numpy.mean(ban_durations))
69 stats_file.write("Median: %.2f days\n" % np.median(ban_durations)) 69 stats_file.write("Median: %.2f days\n" % numpy.median(ban_durations))
70 stats_file.write("Deviation: %.2f\n" % np.std(ban_durations)) 70 stats_file.write("Deviation: %.2f\n" % numpy.std(ban_durations))
71 stats_file.write("Variance: %.2f\n" % np.var(ban_durations)) 71 stats_file.write("Variance: %.2f\n" % numpy.var(ban_durations))
72 72
73if OPEN_FILES: 73if OPEN_FILES:
74 webbrowser.open(STATS_FILE, 2) 74 webbrowser.open(STATS_FILE, 2)