+ 2

Why does the second print not give the output in column vector form?

https://code.sololearn.com/cNUq9Sh1lY4i/?ref=app

24th Mar 2021, 1:30 AM
Sonic
Sonic - avatar
3 Answers
+ 6
The first multiplies 2 times all of the elements in the np array and returns an array of the same structure. The second only applies this to the 0th element of all the subarrays and returns them as a single dimension array. The first is the same as; num12arr*2 While the second returns a slice starting from the first and going to the last and then further getting only the first sub-element of each element in the slice.
24th Mar 2021, 1:48 AM
ChaoticDawg
ChaoticDawg - avatar
+ 2
ChaoticDawg yes I know but why is its shape a row vector and not a column vector?
24th Mar 2021, 8:43 AM
Sonic
Sonic - avatar
+ 1
Can't it be achieved without doing the following? https://code.sololearn.com/c8h2TxhkWh4K/?ref=app
25th Mar 2021, 5:22 AM
Sonic
Sonic - avatar