SciPy - Integration with Scientific Ecosystem
Which of the following is the correct way to add two NumPy arrays
a and b element-wise using vectorization?a and b element-wise using vectorization?c = a + b.for i in range(len(a)): c[i] = a[i] + b[i] uses a loop (not vectorized), np.add(a, b, out=None, where=False) has wrong parameters, c = a.append(b) is invalid for arrays.+ for vectorized array addition [OK]c = a + b for fast element-wise addition [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions