NumPy Arrays Quiz
Last Update Unknown
NumPy Arrays Revision Quiz
How do you implement the vector subtraction between vector u and vector v?
Multiply the numpy array z with the scalar -2:
Consider the lists [1, 2, 3, 4, 5]
and [1, 0, 1, 0, 1]
, and cast both lists to a NumPy array then multiply them together. Is the result a scalar or a vector?
Convert the list [1, 0]
and [0, 1]
to numpy arrays a
and b
. Then, find the dot product. Is the result a scalar or a vector?
Convert the list [1, 1]
and [0, 1]
to numpy arrays a
and b
. Then find the dot product. Is the result a scalar or a vector?
Why are the results of the dot product for [-1, 1]
and [1, 1]
and the dot product for [1, 0]
and [0, 1]
zero, but not zero for the dot product for [1, 1]
and [0, 1]
?
Hint: plot the arrays as vectors in a 2D space.