Nov-05-2020, 02:43 AM
1. This was my quiz and I need help to understand why the correct answer is A? I chose B
The output of the following code is:
X=np.random.random((10,3))
Xmean=X.mean(axis=0)
A. Generate a 10X3 array and get the means of the columns
B. Generate a 10X3 array and get the means of the rows
C. Generate a 3X10 array and get the means of the columns
D. Generate a 3X10 array and get the means of the rows
2. Changing the values in a slice of an array will change the underlying array.
A. True
B. False
I chose False but correct answer is True. Is A correct answer?
Thank you

The output of the following code is:
X=np.random.random((10,3))
Xmean=X.mean(axis=0)
A. Generate a 10X3 array and get the means of the columns
B. Generate a 10X3 array and get the means of the rows
C. Generate a 3X10 array and get the means of the columns
D. Generate a 3X10 array and get the means of the rows
2. Changing the values in a slice of an array will change the underlying array.
A. True
B. False
I chose False but correct answer is True. Is A correct answer?
Thank you