The problem with your original code was that you initialized transpose[t]
at every element, rather than just once per row:
def matrixTranspose(anArray):
transposed = [None]*len(anArray[0])
for t in range(len(anArray)):
transposed[t] = [None]*len(anArray)
for tt in range(len(anArray[t])):
transposed[t][tt] = anArray[tt][t]
print transposed
This works, though there are more Pythonic ways to accomplish the same things, including @J.F.'s zip
application.