Write a NumPy program to compute xy, element-wise where x, y are two given arrays
- برمجة بايثون
- 2021-09-13
- mhanasmh00489829403
الأجوبة
import numpy as np
x = np.array([[1, 2], [3, 4]])
y = np.array([[1, 2], [1, 2]])
print("Array1: ")
print(x)
print("Array1: ")
print(y)
print("Result- x^y:")
r1 = np.power(x, y)
print(r1)
Sample Output:
Array1: [[1 2] [3 4]] Array1: [[1 2] [1 2]] Result- x^y: [[ 1 4] [ 3 16]]
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال