0
 v = np.array([1,2,3])
    In [17]: v.shape
    Out[17]: (3,)

Why isn't the shape [,3]? Because it has only one row and three columns. Isn't it a row vector?

user697911
  • 10,043
  • 25
  • 95
  • 169
  • It's an 1d array. Arrays have no orientations. They just have Dimensions. – MSeifert Jul 29 '18 at 21:15
  • "They just have dimensions". Isn't the dimension "1 by 3"? – user697911 Jul 29 '18 at 21:25
  • There is no such thing as `(, 3)` in Python. See also [Difference between these array shapes in numpy](https://stackoverflow.com/q/27570756) and [why an extra comma in the shape of a single index numpy array](https://stackoverflow.com/q/46134891) –  Jul 29 '18 at 21:52
  • Why just 1 by 3? Why not 1 by 1 by 3 by 1? Addi g those extra dimensions is just a convenience for humans. The code has no problems working with 1d arrays. Python lists are 1d. – hpaulj Jul 30 '18 at 00:17

0 Answers0