“menghasilkan python matriks integer acak” Kode Jawaban

menghasilkan python matriks integer acak

import numpy as np

randi_arr = np.random.randint(start, end, dimensions)
#random integers will be sampled from [start, end) (end not inclusive)
#end is optional; if end is not specified, random integers will be sampled from [0, start) (start not inclusive)
#dimensions can be specified as shown here; (m,n) #2D array with size 'm x n'
Plain Pintail

Bagaimana Anda membuat matriks bilangan bulat acak di Numpy?

# importing numpy library
import numpy as np  
  
# random is a function, doing random sampling in numpy.
array = np.random.randint(10, size=(20))
  
# the array will be having 20 elements.
print(array)https://www.geeksforgeeks.org/how-to-create-a-matrix-of-random-integers-in-python/#:~:text=To%20create%20a%20matrix%20of%20random%20integers%20in%20Python%2C%20randint,cannot%20be%20predicted%20at%20hand.&text=Parameters%20%3A,be%20drawn%20from%20the%20distribution.
Jealous Jackal

Jawaban yang mirip dengan “menghasilkan python matriks integer acak”

Pertanyaan yang mirip dengan “menghasilkan python matriks integer acak”

Lebih banyak jawaban terkait untuk “menghasilkan python matriks integer acak” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya