问题 I have an array of true/false values with a very simple structure: # the real array has hundreds of thousands of items positions = np.array([True, False, False, False, True, True, True, True, False, False, False], dtype=np.bool) I want to traverse this array and output the places where changes happen (true becomes false or the contrary). For this purpose, I've put together two different approaches: a recursive binary search (see if all values are the same, if not, split in two, then recurse)