I hope this helps you . Your transpose is pretty much exactly what you need. With any solution you'd choose, you'd have to buffer the unused values (e.g. to get to the 7, you have to read 1-6, and store them in memory for when the other iterables ask for them). tee already does exactly that kind of buffering, so there's no need implementing it yourself.
teed = itertools.tee(iterable_of_three_tuples, 3)
return ( e for e in teed ), ( e for e in teed ), ( e for e in teed )
How to transpose a 3D list in python?
By : Kristina Aleshnikova
Date : March 29 2020, 07:55 AM
Any of those help Let's say I have this matrix m of dimensions 9 x 9 x 26: , If you have a list and not a numpy array: