I have a list of arrays:
[array([1,2,3,4],dtype=float32), array([5,6,7,8],dtype=float32)]
How can I reverse this list so that it looks like:
[array([5,6,7,8],dtype=float32), array([1,2,3,4],dtype=float32)]
this?
I have a list of arrays:
[array([1,2,3,4],dtype=float32), array([5,6,7,8],dtype=float32)]
How can I reverse this list so that it looks like:
[array([5,6,7,8],dtype=float32), array([1,2,3,4],dtype=float32)]
this?
Just use negative step:
from numpy import array
a = [array([1,2,3,4],dtype='float32'), array([5,6,7,8],dtype='float32')]
a[::-1]
You can reach with using this:
li = li[::-1]
That way, you assign li with the reversed list of lists.