I am trying to create a matrix transpose function for python but I can\'t seem to make it work. Say I have
theArray = [[\'a\',\'b\',\'c\'],[\'d\',\'e\',\'f\
You may do it simply using python comprehension.
arr = [ ['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i'] ] transpose = [[arr[y][x] for y in range(len(arr))] for x in range(len(arr[0]))]