Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

np.random.seed

import numpy as np
np.random.seed(42)
random_numbers = np.random.random(size=4)
random_numbers
Comment

np random seed

>>> import numpy as np
>>> 
>>> np.random.seed(0)
>>> 
>>> np.random.rand(3)
array([0.5488135 , 0.71518937, 0.60276338])
>>> np.random.rand(3)
array([0.54488318, 0.4236548 , 0.64589411])
>>> 
>>> 
>>> np.random.seed(1)
>>> 
>>> np.random.rand(3)
array([4.17022005e-01, 7.20324493e-01, 1.14374817e-04])
>>> np.random.rand(3)
array([0.30233257, 0.14675589, 0.09233859])
>>> 
>>> 
>>> np.random.seed(0)
>>> 
>>> np.random.rand(3)
array([0.5488135 , 0.71518937, 0.60276338])
>>> np.random.rand(3)
array([0.54488318, 0.4236548 , 0.64589411])
Comment

np.random.seed

array([0.3745012, 0.95071431, 0.73199394, 0.59865848])
Comment

PREVIOUS NEXT
Code Example
Python :: python webbrowser 
Python :: reverse list python 
Python :: is string python 
Python :: python max absolute value 
Python :: remove item from list while looping 
Python :: pandas read csv without index 
Python :: boston data set to pandas df 
Python :: lisy in python 
Python :: message box for python 
Python :: print(DATA.popitem()) 
Python :: serving static audio files with flask in react 
Python :: udmi2 roblox 
Python :: what is the meaning of illiteral with base 10 
Python :: your generated code is out of date and must be regenerated with protoc = 3.19.0 tensorflow 
Python :: how to set the location on a pygame window 
Python :: how to loop through files in a directory python 
Python :: multiline input in python 
Python :: pandas timedelta to seconds 
Python :: decyphing vigener cypher without key 
Python :: how to remove trackback on python when ctrl c 
Python :: media url django 
Python :: listing index elasticsearch python 
Python :: python import upper directory 
Python :: JUPYTER CONSUMES 100 disk 
Python :: Source Code: Matrix Multiplication Using Nested List Comprehension 
Python :: pandas groupby without reset index 
Python :: python run another python script 
Python :: python die 
Python :: edit line if str end with pandas 
Python :: datetime current year 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =