ΣνΜDr. Sharon's Math PlatformSyvara Learning
Question Bank › 📘 Undergraduate › Programming for Engineers › Q5

Q5 · NumPy: indexing, element-wise ops, transpose, and b @ d

NumPy Arrays and Matrix Operations 🟡 Intermediate Coding
Question

Given:

  y = np.array([[1, 4, 3], [9, 2, 7]])
  b = np.array([[1, 2], [3, 4]])
  d = np.array([[3, 4], [5, 6]])

(a) Extract the first row of y.
(b) Extract columns 0 and 2 of y.
(c) Compute b + d, b * d (element-wise), and b.T (transpose).
(d) Compute b @ d (matrix multiplication). Explain the difference between b * d and b @ d.

🔒

Log in to see the worked solution

Enter your email to get started. Your first free solutions in every course unlock as soon as you verify.

Log in or sign up with email
← Previous Next →
Working…