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 :: pyplot width 
Python :: print in binary python 
Python :: np array to tuple 
Python :: replace string if it contains a substring pandas 
Python :: python class 
Python :: python classes 
Python :: python read lines 
Python :: output path jupyter 
Python :: python install jedi 
Python :: import excel python 
Python :: matplotlib position legend 
Python :: dataframe create 
Python :: python generate random string 
Python :: delete all elements in list python 
Python :: Extract column from a pandas dataframe 
Python :: how to make python turn a list into a text file grapper 
Python :: Python NumPy swapaxis Function Syntax 
Python :: change shortcuts in pychar, 
Python :: how to make a stopwatch in python 
Python :: indentation levels in programming 
Python :: delete migrations django and start over deployment heroku 
Python :: python list prime numbers 
Python :: python do while 
Python :: python how to get user input 
Python :: string formatting in python 
Python :: python tkinter colored line 
Python :: numpy linspace 
Python :: networkx max degree node 
Python :: copy website python 
Python :: df .sort_values 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =