Write a NumPy program to create a new array of 3*5, filled with 2
- برمجة بايثون
- 2021-09-12
- mhanasmh00489829403
الأجوبة
import numpy as np
#using no.full
x = np.full((3, 5), 2, dtype=np.uint)
print(x)
#using no.ones
y = np.ones([3, 5], dtype=np.uint) *2
print(y)
Sample Output:
[[2 2 2 2 2] [2 2 2 2 2] [2 2 2 2 2]] [[2 2 2 2 2] [2 2 2 2 2] [2 2 2 2 2]]
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
