Python: turn single array of sorted, repeat values into an array of arrays?
<p>I have a sorted array with some repeated values.  How can this array be turned into an array of arrays with the subarrays grouped by value (see below)? In actuality, my_first_array has ~8 million entries, so the solution would preferably be as time efficient as possible.</p>

<pre><code>my_first_array = [1,1,1,3,5,5,9,9,9,9,9,10,23,23]

wanted_array = [ [1,1,1], [3], [5,5], [9,9,9,9,9], [10], [23,23] ]
</code></pre>