I want to flip a 2d list from list(2,3) to list(3,2) and shift the items diagonally:
from
a | b |
---|---|
c | d |
e | f |
to
a | c | e |
---|---|---|
b | d | f |
I managed to shift the rows and columns but now every entry is the same. meaning:
b | d | f |
---|---|---|
b | d | f |
I know that has something to do with changing the original and not the a copy, but I don't know how to fix that. Can someone please help me? That is my code:
a=0
for array in bridge_arr:
b=0
for item in array:
arr[b][a] = bridge_arr[a][b]
b+=1
a+=1