Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

np.rand.randint

np.random.randint(0,10, size=(5, 5)) # random integers from 0 to 10 in size 5,5
#o/p 
array([[3, 9, 2, 3, 5],
       [2, 8, 7, 7, 1],
       [8, 2, 1, 1, 9],
       [9, 0, 5, 6, 4],
       [1, 6, 6, 4, 6]])
Comment

numpy randint

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

np.random.randint

# random.randint(low, high=None, size=None, dtype=int)
# [low,high) if high is given, else [0, low)
Comment

PREVIOUS NEXT
Code Example
Python :: count python 
Python :: find the range in python 
Python :: add key value in each dictonary in the list 
Python :: python symbol 
Python :: fastest way to check odd or even in python 
Python :: what does tuple mean in python 
Python :: python run uvicorn 
Python :: raspbian run a python script at startup 
Python :: initialize variable python 
Python :: how to join two tuples in python 
Python :: using comma as the thousand separator 
Python :: pynput keyboard backspace 
Python :: jquery datepicker disable 
Python :: django model queries 
Python :: how to create a save command in python 
Python :: python palindrome program 
Python :: python discord bot embed 
Python :: python how to get rid of spaces in print 
Python :: printing hello world in python 
Python :: three different randomn numbers python 
Python :: python random distribution 
Python :: # get the largest number in a list and print its indexes 
Python :: division operators in python 
Python :: ValueError: tuple.index(x): x not in tuple 
Python :: pandas merge_asof direction 
Python :: configure your keyboards 
Python :: python - retrieve unconnected node pairs 
Python :: tkinter yt downloader with resolution 
Shell :: kill localhost 3000 ubuntu 
Shell :: what is --use-feature=2020-resolver 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =