Python Forum
Help With Function to search a list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help With Function to search a list
#3
what i have now is a for loop which find every number which is greater than or equal to threshold.

threshold = 15
pattern_width = 4
data_series = [-1, 5, 4, 8, 3, 21, 18, 16, 3, 2, 3, 1, 4, 5, 17, 22, 36, 33, 34, 9, 1, -2]
data_series = data_series + [-2, 4, -1, 7, 13, 12, 3, 1, 4, 5, 26, 22, 28, 27, 26, 2, 8, 6]

greater_than_threshold = [i for i in data_series if i >= threshold]
overlapping = when the distance between indices is < pattern_width

Next i want to go through each value in the greater_than_threshold list and
if chosen value at index < value within an overlapping index, then disregard that value

Could you please help me on how i can do this without using numpy or other complex python built in functions?
Reply


Messages In This Thread
Help With Function to search a list - by johnissa - Apr-23-2018, 10:40 AM
RE: Help With Function to search a list - by johnissa - Apr-24-2018, 08:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Search character from 2d list to 2d list AHK2019 3 2,555 Sep-25-2019, 08:14 PM
Last Post: ichabod801
  I donr know how to search from 2d list to 2d list AHK2019 1 1,800 Sep-25-2019, 01:59 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020