diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2014-02-02 16:53:22 -0500 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2014-02-02 16:53:22 -0500 |
| commit | 7426d8ff0e7969eb1a86bdb5bec8a0c971309e2b (patch) | |
| tree | 323d6a9a4423b51fbebb37c115fddeab1c7a9641 /distribution.py | |
| parent | a0e95b0843d4e366e4b979685f7c821954afebc6 (diff) | |
| download | fast-seeding-7426d8ff0e7969eb1a86bdb5bec8a0c971309e2b.tar.gz | |
Facebook scraping
Diffstat (limited to 'distribution.py')
| -rw-r--r-- | distribution.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/distribution.py b/distribution.py new file mode 100644 index 0000000..49d2d5e --- /dev/null +++ b/distribution.py @@ -0,0 +1,30 @@ +import matplotlib.pyplot as plt +import numpy as np +import sys + + +def load_distribution(filename): + l = [int(line.strip()) for line in open(filename)] + l = sorted(l) + l = l[:] + return l + + +def plot_distribution(files): + for file in files: + x = load_distribution(file) + a = np.array(x) + print file, a.mean(), a.size + n, bins, patches = plt.hist(x, 50, normed=1, facecolor='green') + plt.show() + # # n_nodes = float(sum(y)) + # plt.plot(x, np.array(y), ".") + # if save: + # fig = plt.gcf() + # fig.set_size_inches(20, 15) + # # plt.savefig(output, bbox_inches="tight") + # else: + # plt.show() + +if __name__ == "__main__": + plot_distribution(sys.argv[1:]) |
