Here is a Assignment to find
1.Maximum peak values
2.Counting number of peaks
3.counting No. reps (using zero corrections).
import matplotlib.pyplot as plt
l= [6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,8,8,9,9,12,12,14,14,21,21,21,21,26,26,30,32,32,39,39,42,44,44,47,49,56,56,59,61,61,69,69,71,74,74,76,81,83,85, 88,88,92,93,95,96,96,99,99,101,102,104,107,107,111,111,111,113,113,113,115,116,116,116,117,120,120,121,122,122,123,123,123,124,124,123,123,123,123,122,120,120,118,116,111,111,103,103,96,96,90,87,84,82,79,79,74,74,69,66,62,59,56,54,52,52,50,48,43,43,40,38,31,31,30,28,28,24,24,24,23,22,22,22,21,20,19,19,18,18,18,17,17,17,16,16,16,16,15,15,15,15,15,15,15,15,14,14,14,14,14,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,16,17,18,19,21,23,25,27,27,30,36,38,41,44,47,50,53,56,56,61,61,63,66,70,72,73,73,75,81,81,83,85,87,88,88,92,92,92,94,94,95,97,97,99,102,102,103,104,105,106,106,106,107,109,110,111,111,112,114,114,114,114,116,116,117,118,119,120,120,120,121,121,121,121,122,122,122,121,121,121,121,121,121,121,121,121,121,121,121,121,121,120,120,118,118,116,107,107,107,104,101,94,91,89,89,81,81,79,76,74,72,69,69,63,63,57,57,51,48,45,43,41,39,39,36,34,34,33,30,30,29,27,27,25,25,24,24,23,23,22,20,20,19,19,19,17,17,16,16,16,15,15,14,14,14,14,14,13,13,13,13,12,12,12,12,12,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,13,13,17,17,19,21,23,25,28,31,34,34,40,40,46,49,49,54,56,58,58,64,64,64,67,72,76,79,82,85,85,87,90,91,92,92,94,95,96,96,97,99,99,100,102,102,104,104,106,106,107,108,109,109,112,113,113,114,115,115,116,116,117,117,118,118,118,118,118,119,119,119,120,120,121,121,121,122,122,122,122,123,123,124,124,124,124,125,125,125,125,125,125,125,125,124,124,124,122,122,117,117,112,112,106,106,103,99,90,90,86,83,79,77,74,72,69,66,63,63,57,57,49,49,46,43,40,37,35,32,30,30,26,23,21,20,20,17,17,15,14,12,10,6,5,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,9,9,10,10,13,13,16,16,20,20,24,24,26,30,32,33,33,38,38,42,44,47,49,52,54,54,59,59,64,64,69,70,72,72,73,74,74,74,74,74,74,74,74,74,73,73,73,73,73,72,72,72,72,72,72,72,70,69,69,67,67,66,65,64,60,60,60,58,56,53,46,42,42,39,32,32,28,21,21,21,19,18,17,16,15,15,15,13,13,12,12,10,10,10,9,9,9,9,9,9,9,9,9,9,9,8,8,8,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,9,9,9,11,14,16,16,19,21,24,25,25,27,29,31,32,34,36,37,41,41,45,45,48,48,52,54,56,57,59,60,62,62,65,66,67,69,69,73,73,75,76,76,78,78,79,79,79,78,78,78,78,78,78,77,77,77,77,77,77,77,76,76,76,75,75,72,72,71,69,68,68,61,59,59,59,53,53,50,50,48,42,39,37,34,31,31,25,23,23,18,18,18,16,15,12,12,10,9,8,8,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,9,9,10,10,11,11,13,13,14,18,18,20,22,24,24,26,30,30,33,35,38,40,44,46,46,49,49,51,54,54,57,59,60,62,64,64,67,69,70,70,73,73,74,74,74,74,74,75,74,74,74,74,74,74,74,74,73,73,73,72,71,70,69,68,66,65,63,61,59,59,55,55,53,47,45,42,42,39,33,31,31,28,24,24,20,20,19,15,15,14,13,13,11,11,10,9,9,8,7,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6]
max_val = None
for num in l:
if (max_val is None or num > max_val):
max_val = num
print('Maximum value-', max_val)
plt.plot(l,marker="o")
plt.show()
import matplotlib.pyplot as plt
from collections import Counter
l=[6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,8,8,9,9,12,12,14,14,21,21,21,21,26,26,30,32,32,39,39,42,44,44,47,49,56,56,59,61,61,69,69,71,74,74,76,81,83,85,88,88,92,93,95,96,96,99,99,101,102,104,107,107,111,111,111,113,113,113,115,116,116,116,117,120,120,121,122,122,123,123,123,124,124,123,123,123,123,122,120,120,118,116,111,111,103,103,96,96,90,87,84,82,79,79,74,74,69,66,62,59,56,54,52,52,50,48,43,43,40,38,31,31,30,28,28,24,24,24,23,22,22,22,21,20,19,19,18,18,18,17,17,17,16,16,16,16,15,15,15,15,15,15,15,15,14,14,14,14,14,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,16,17,18,19,21,23,25,27,27,30,36,38,41,44,47,50,53,56,56,61,61,63,66,70,72,73,73,75,81,81,83,85,87,88,88,92,92,92,94,94,95,97,97,99,102,102,103,104,105,106,106,106,107,109,110,111,111,112,114,114,114,114,116,116,117,118,119,120,120,120,121,121,121,121,122,122,122,121,121,121,121,121,121,121,121,121,121,121,121,121,121,120,120,118,118,116,107,107,107,104,101,94,91,89,89,81,81,79,76,74,72,69,69,63,63,57,57,51,48,45,43,41,39,39,36,34,34,33,30,30,29,27,27,25,25,24,24,23,23,22,20,20,19,19,19,17,17,16,16,16,15,15,14,14,14,14,14,13,13,13,13,12,12,12,12,12,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,13,13,17,17,19,21,23,25,28,31,34,34,40,40,46,49,49,54,56,58,58,64,64,64,67,72,76,79,82,85,85,87,90,91,92,92,94,95,96,96,97,99,99,100,102,102,104,104,106,106,107,108,109,109,112,113,113,114,115,115,116,116,117,117,118,118,118,118,118,119,119,119,120,120,121,121,121,122,122,122,122,123,123,124,124,124,124,125,125,125,125,125,125,125,125,124,124,124,122,122,117,117,112,112,106,106,103,99,90,90,86,83,79,77,74,72,69,66,63,63,57,57,49,49,46,43,40,37,35,32,30,30,26,23,21,20,20,17,17,15,14,12,10,6,5,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,9,9,10,10,13,13,16,16,20,20,24,24,26,30,32,33,33,38,38,42,44,47,49,52,54,54,59,59,64,64,69,70,72,72,73,74,74,74,74,74,74,74,74,74,73,73,73,73,73,72,72,72,72,72,72,72,70,69,69,67,67,66,65,64,60,60,60,58,56,53,46,42,42,39,32,32,28,21,21,21,19,18,17,16,15,15,15,13,13,12,12,10,10,10,9,9,9,9,9,9,9,9,9,9,9,8,8,8,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,9,9,9,11,14,16,16,19,21,24,25,25,27,29,31,32,34,36,37,41,41,45,45,48,48,52,54,56,57,59,60,62,62,65,66,67,69,69,73,73,75,76,76,78,78,79,79,79,78,78,78,78,78,78,77,77,77,77,77,77,77,76,76,76,75,75,72,72,71,69,68,68,61,59,59,59,53,53,50,50,48,42,39,37,34,31,31,25,23,23,18,18,18,16,15,12,12,10,9,8,8,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,9,9,10,10,11,11,13,13,14,18,18,20,22,24,24,26,30,30,33,35,38,40,44,46,46,49,49,51,54,54,57,59,60,62,64,64,67,69,70,70,73,73,74,74,74,74,74,75,74,74,74,74,74,74,74,74,73,73,73,72,71,70,69,68,66,65,63,61,59,59,55,55,53,47,45,42,42,39,33,31,31,28,24,24,20,20,19,15,15,14,13,13,11,11,10,9,9,8,7,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6]
max_value=None
for num in l:
if(max_value is None or num>max_value):
max_value=num
for num in l:
if (num==max_value):
plt.plot(num,marker=".")
j=Counter (l)
print(j)
print("maxmimum value:",max_value)
plt.grid()
plt.show()
OrderedDict([(4, 9), (5, 10), (6, 72), (7, 44), (8, 15), (9, 23), (10, 10), (11, 31), (12, 18), (13, 19), (14, 30), (15, 18), (16, 14), (17, 11), (18, 10), (19, 10), (20, 10), (21, 12), (22, 5), (23, 8), (24, 12), (25, 7), (26, 5), (27, 5), (28, 5), (29, 2), (30, 10), (31, 8), (32, 7), (33, 5), (34, 6), (35, 2), (36, 3), (37, 3), (38, 5), (39, 7), (40, 5), (41, 4), (42, 7), (43, 4), (44, 5), (45, 4), (46, 5), (47, 4), (48, 5), (49, 8), (50, 4), (51, 2), (52, 4), (53, 5), (54, 7), (55, 2), (56, 8), (57, 6), (58, 3), (59, 11), (60, 5), (61, 6), (62, 4), (63, 6), (64, 8), (65, 3), (66, 6), (67, 5), (68, 3), (69, 14), (70, 6), (71, 3), (72, 16), (73, 15), (74, 28), (75, 5), (76, 8), (77, 8), (78, 8), (79, 8), (81, 5), (82, 2), (83, 3), (84, 1), (85, 4), (86, 1), (87, 3), (88, 4), (89, 2), (90, 4), (91, 2), (92, 6), (93, 1), (94, 4), (95, 3), (96, 6), (97, 3), (99, 6), (100, 1), (101, 2), (102, 5), (103, 4), (104, 5), (105, 1), (106, 7), (107, 7), (108, 1), (109, 3), (110, 1), (111, 7), (112, 4), (113, 5), (114, 5), (115, 3), (116, 9), (117, 6), (118, 9), (119, 4), (120, 11), (121, 22), (122, 12), (123, 9), (124, 9), (125, 8)])
maxmimum value: 125