Drop While

Remove elements from the start of an array while a condition is true.

Code

General
from itertools import dropwhile
return list(dropwhile(lambda x: x < threshold, arr))

Parameters

Array

Drop while less than threshold

Server

More Python Snippets