Last answered:

09 Feb 2024

Posted on:

24 May 2023

3

Resolved: Question about shape vector

Good afternoon.
During the video it is commented that when creating a vector, by default this is a row vector.
For example-->v = np.array([3,2,5])

This vector will have the form -->[3,2,5]  ---> ( 1 row ,3 colums) 
And when we use the print(v) function, it has that output.
However using v.shape , we get (3,)

Why we get (3,) instead of ( 1 ,3)--> if 1st element refers rows ans second to the colums.

And why before do v_3= v_2 .reshape(1.3) to v_2 --->  v_3 is equal v, why ¿v_3.shape --> (1,3) 

Does this(3,) correspond to 3 rows?

Thank you in advance for your help.  :)

1 answers ( 1 marked as helpful)
Posted on:

09 Feb 2024

1

I realize that when i creatde v i did it like 1D array( more or less like vector), and when y reshape v to v_2 and v_3 i did a 2D array (matrix).


To create V with (1,3) dimension i should do .

v = np.array([[3, 2 , 5]])


Just to close question :)

Submit an answer