Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fname = 'f:\\питон\\dataset_3380_5.txt'
- ClassQuantity = 11
- Table = dict()
- ArrayOfHeight = [0] * ClassQuantity
- ArrayOfAmount = [0] * ClassQuantity
- InfoFile = open(fname, 'r')
- for line in InfoFile:
- s = line.strip().split('\t')
- s[0] = int(s[0])
- ArrayOfAmount[s[0] - 1] += 1
- ArrayOfHeight[s[0] - 1] += int(s[2])
- InfoFile.close()
- for i in range(ClassQuantity):
- if ArrayOfAmount[i] == 0:
- print(i + 1, '-')
- else:
- print(i + 1, float(ArrayOfHeight[i] / ArrayOfAmount[i]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement