Python Programming - Arrays - Discussion

Discussion Forum : Arrays - General Questions (Q.No. 29)
29.
How do you perform element-wise addition of a scalar value, 5, to a NumPy array arr?
np.add_scalar(arr, 5)
arr.add(5)
arr + 5
np.scalar_add(arr, 5)
Answer: Option
Explanation:
The + operator can be used for element-wise addition of a scalar value to a NumPy array.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.