SHARE
TWEET

Untitled

a guest Oct 13th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. matrix = [
  2.     [1, 2, 3, 4],
  3.     [5, 6, 7, 8],
  4.     [9, 10, 11, 12],
  5. ]
  6.  
  7. # transposed matrix MORE itemized
  8.  
  9. transposed2 = []   # "transposed" wird die transformierte matrix    
  10.    # werden die die neuen Reihen
  11.  
  12. for i2 in range(len(matrix[0])):  # es gibt 4 Einträge "i2" je Liste
  13.     """ for each "i2" in length of vecotr in matrix
  14.    """
  15.     new_row2 = []
  16.     print(transposed2)
  17.     print(new_row2)
  18.     for row2 in matrix:   # für jede Liste "row2" in matrix
  19.         """for each
  20.        """
  21.         new_row2.append(row2[i2])
  22.     transposed2.append(new_row2)
  23.  
  24. print(transposed2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top