Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Set a random seed

numpy.random.seed(42)
Comment

random set seed

# random module is imported
import random
 
# Any number can be used in place of '0'.
random.seed(0)

# Generated random number will be between 1 to 1000.
print(random.randint(1, 1000))
Comment

PREVIOUS NEXT
Code Example
Python :: python replace char in string 
Python :: how to sort values of pandas dataframe for iqr 
Python :: print map object python 
Python :: flask flash not working 
Python :: how to round off values in columns in pandas in excel 
Python ::  in python 
Python :: python depth first search 
Python :: slicing string in python 
Python :: pandas pad method 
Python :: pandas dataframe read string as date 
Python :: how to add vertical line on subplot in matplotlib 
Python :: how to add two numbers in python 
Python :: pandas iterrows 
Python :: convert price to float python 
Python :: pandas write to excel 
Python :: check if path exists python 
Python :: python check for duplicate 
Python :: how to append a number to a list in python 
Python :: f string in python 
Python :: pandas column name equal to another column value 
Python :: index in list 
Python :: how to install python 3.6.0 on debian 
Python :: pip install streamlit 
Python :: get mode dataframe 
Python :: opencv invert image 
Python :: pandas remove outliers for multiple columns 
Python :: python append to 2d array 
Python :: how to update requirements.txt python 
Python :: pandas select a row 
Python :: how to do disconnect command on member in discord python 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =