我有一個'row'向量作爲numpy ndarray投射。我只是想將它作爲'列'向量(我不關心類型,只要它與matplotlib兼容)。下面是我想要一個例子:1D的開關尺寸ndarray
import numpy as np
a = np.ndarray(shape=(1,4), dtype=float, order='F')
print(a.shape)
a.T #I think this performs the transpose?
print(a.shape)
輸出看起來是這樣的:
(1, 4)
(1, 4)
我希望得到:
(1, 4)
(4, 1)
有人能指出我正確的方向?我已經看到numpy中的轉置不會對一維數組做任何事情。但這是一維數組嗎?