Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: getting previous/next valid value in a list, cyclically
Post: RE: getting previous/next valid value in a list, c...

(Mar-19-2018, 11:03 PM)Gribouillis Wrote: You can use module bisect Thanks! Works perfectly.
studeo General Coding Help 5 4,111 Mar-20-2018, 11:01 AM
    Thread: getting previous/next valid value in a list, cyclically
Post: RE: getting previous/next valid value in a list, c...

example_values = [None, None, 2, None, 4, None, None, 7, None, None] for i, v in enumerate(example_values): if v is not None: print("value at position {} is valid: {}".format(i,v)) els...
studeo General Coding Help 5 4,111 Mar-19-2018, 06:02 PM
    Thread: getting previous/next valid value in a list, cyclically
Post: getting previous/next valid value in a list, cycli...

I have a list of values... some are valid, some invalid (containing None). I test each element for validity. When I find an invalid element, I need to find indexes of the closest previous and the clos...
studeo General Coding Help 5 4,111 Mar-19-2018, 03:30 PM

User Panel Messages

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