Data Fundamentals (H) - Week 02 Quiz
1. x is (15,4). y is (15,). How would I add the values in y to each row of x?
x[:,0] * y
x + y
(x.T + y).T
Impossible, shape mismatch
x + y[:,:]
2. x is shape (3,3). What does the operation
x[:, [1,0,2]]
do?
Exchanges the exponent and mantissa of x
Impossible, undefined operation
Returns a new array with the columns of x replaced with [1,0,2]
Returns a new array with the first two columns of x exchanged
Invokes the NumPy self-destruct sequence
3. A strided array data structure means that:
transpose has time complexity O(N)
transpose cannot be performed without making a copy.
values in arrays are in undefined order
transpose has time complexity O(1)
array legs are very long
4. Not a number (NaN) is represented in IEEE 754 as:
an exponent of all 0s
an exponent of all 1s
a mantissa equal to the exponent
a mantissa that evaluates to 666
a sign of -3
5. Which of these is not a IEEE 754 floating point exception?
inexact operation
underflow
incomplete operation
invalid operation
overflow
6. x is (10,4) and y is (4,4). Which of these operations results in x and y joined into a (14,4) array?
np.concatentate([x,y], axis=1)
np.stack([x,y], axis=-1)
np.concatentate([x,y], axis=0)
np.join(x,y)
np.stack([x,y])
Submit Quiz