2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Numpy (n,)と(n,1)表記の違いについて【横ベクトルか縦ベクトルかの違い】

Last updated at Posted at 2019-12-19

はじめに

Numpyのndarray配列のshapeを見ると、(n,1)や(n,)といった表記を目にします。「1次元配列なら【,】も【1】も不要なのでは?」と思って調べてみました。
##結論

(n,)は横ベクトルの配列(ただの1次元配列)

###(n,1)は縦ベクトルの配列
コメント 2019-12-22 203229.png

※1次元の配列は.Tでは転置に変換することができないので、reshapeを用いる必要があります。

2
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?