Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- fname = 'satcat_download.txt'
- with open(fname, 'r') as infile:
- lines = infile.readlines()
- dic = dict()
- for line in lines:
- year, num = int(line[0:4]), int(line[5:8])
- try:
- dic[year].append(num)
- except:
- dic[year] = [num]
- data = [(a, sorted(set(b))) for a, b in sorted(dic.items())]
- if True:
- for a, b in data:
- print(a, len(b), b[-1], len(b) == b[-1])
- years = np.array([x[0] for x in data])
- number = np.array([len(x[1]) for x in data])
- highest = np.array([x[1][-1] for x in data])
- disagree = highest != number
- yeardots = years[disagree]
- numberdots = number[disagree]
- plt.figure()
- plt.plot(years, number)
- plt.plot(years, highest)
- plt.plot(yeardots, numberdots, 'ok', mfc='none', ms=20)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement