Write a NumPy program to create a two-dimensional array with shape (8,5) of random numbers. Select random numbers from a normal distribution (200,7)
- برمجة بايثون
- 2021-09-11
- mhanasmh00489829403
الأجوبة
import numpy as np
np.random.seed(20)
cbrt = np.cbrt(7)
nd1 = 200
print(cbrt * np.random.randn(10, 4) + nd1)
Sample Output:
[[201.6908267 200.37467631 200.68394275 195.51750123] [197.92478992 201.07066048 201.79714021 198.1282331 ] [200.96238963 200.77744291 200.61875865 199.05613894] [198.48492638 198.38860811 197.55239946 200.47003621] [199.91545839 202.99877319 202.01069857 200.77735483] [199.67739161 193.89831807 202.14273593 202.54951299] [199.53450969 199.7512602 199.79145727 202.97687757] [200.24634413 196.04606934 198.30611253 197.88701546] [201.78450912 203.94032834 198.21152803 196.91446071] [201.0082481 197.03285104 200.63052763 197.82590294]]
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال