Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import collections, functools, operator
- import matplotlib.pyplot as plt
- s={}
- result={}
- with open('nombre_archivo.out') as f:
- lines = f.readlines()
- for line in lines:
- s = dict(zip(*np.unique(np.fromstring(line, dtype=int, sep=','), return_counts=True)))
- result = dict(functools.reduce(operator.add, map(collections.Counter, [result, s])))
- plt.plot(list(result.keys())[1:], list(result.values())[1:], '.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement