“variedad de enteros aleatorios python” Código de respuesta

variedad de enteros aleatorios python

>>> np.random.randint(2, size=10)
array([1, 0, 0, 0, 1, 1, 0, 0, 1, 0])
>>> np.random.randint(1, size=10)
array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
D Goglia

Generar Matriz Integer Random Python

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

Respuestas similares a “variedad de enteros aleatorios python”

Preguntas similares a “variedad de enteros aleatorios python”

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código