Loading...
Perform basic arithmetic operations on NumPy arrays.
NumPy supports element-wise arithmetic:
Write a function array_arithmetic(arr, n) that returns a dictionary with:
Return a dictionary with exactly these four keys.
arr = [10, 20, 30], n = 5
{'add': [15, 25, 35], 'subtract': [5, 15, 25], 'multiply': [50, 100, 150], 'divide': [2.0, 4.0, 6.0]}Element-wise operations apply to each element