Numpy
Table of Contents
  • array

http://stackoverflow.com/questions/5954603/transposing-a-numpy-array#5954747

transpose for a = np.array([1,2,3]) is the same as itself as a is one dimension, if we want 2D:

[[1],
[2],
[3]]

- a.reshape(-1, 1);
- a[:, np.newaxis] or a[:, None]
- a[np.newaxis].T
- m = np.matrix(a).T
- n = np.array([a]).T

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License