Sequential chaining of itertools operators
Sequential chaining of itertools operators Question: I’m looking for a nice way to sequentially combine two itertools operators. As an example, suppose we want to select numbers from a generator sequence less than a threshold, after having gotten past that threshold. For a threshold of 12000, these would correspond to it.takewhile(lambda x: x<12000) and it.takewhile(lambda …