+ 2
Why does the second print not give the output in column vector form?
3 ответов
+ 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.
+ 2
ChaoticDawg yes I know but why is its shape a row vector and not a column vector?
+ 1
Can't it be achieved without doing the following?
https://code.sololearn.com/c8h2TxhkWh4K/?ref=app