if you have a list of values:
values=['130','90','150','123','133','120','160','180','45','67','55','34','130','120']
and wanted to scan through with a window size of 6 and if 4 out of the 6 were >= 100 then keep scanning until there were 4 in a row that were < 100 and then not include those in the list
so for example with an empty list called results:
results=[]
i would like to append those values that satisfied the criteria into the empty list to get
results=['130','90','150','123','133','120','160','180']
i know i have convert all the strings into integers with int() but that's not the part that i'm having trouble with. i'm having trouble finding the 4 out of the window size 6 that are >= 100
i was trying:
count=0
for i in values:
if int(i)=> 100:
count=count+1
but it wasn't working
the window size is 6 so the first window would be ['130','90','150','123','133','120'] and 5 out of 6 of those values are over 100 so progress one place over and then window would be ['90','150','123','133','120','160'] again it would be 5 out of 6 being over 100 so it would progress over one more place . not until it reaches the window with ['160','180','45','67','55','34'] would it stop b/c there were 4 consecutive values less than 100 in a row. so it would put all the values from '130' to '180' in the list. Hope that explains it better