Learn Python
Learn Data Structure & Algorithm
Numpy Introduction
Numpy Array
Numpy Attributes
Numpy generate random numbers
Numpy Slicing
Numpy Concatenate & split
Numpy Insert & delete
Numpy Math
Numpy Condition
Numpy Reshaping
Learn Pandas
Matplotlib
Learn Seaborn
Learn Statistics
Learn Math
Learn MATLAB
Learn Machine learning
Learn Github
Learn OpenCV
Learn Deep Learning
Learn MySQL
Learn MongoDB
Learn Web scraping
Learn Excel
Learn Power BI
Learn Tableau
Learn Docker
Learn Hadoop
random.randint() generates an array that contains random numbers. In the bracket first value is for the starting point of the number, the second value is for the ending point of the number and the third value is for how many numbers you want between starting and ending points. So this function will create an array which will contain random numbers according to the given parameters. Each time you execute the code will generate new numbers.
It will generate float random values in an array between 0.0 to 1.0. So we can say that this function will create an array that will contain random float values between 0.0 to 1.0. In the bracket of the function, we have to pass how many random float numbers we want.
random.rand() function generates numbers between 0 to 1 and then creates an array. In the function bracket write row and column number. It means how many columns and rows you want in the array. In the bracket first value is for the row and the second value is for the column.
random.randn() function generates negative and positive number near 0 and then creates an array. In the function bracket pass the row and column number. It means how many columns and rows you want in the array. In the bracket first value is for the row and the second value is for the column.
What happens while using random.ranint() function is, every time you refresh the code, you will get new numbers. But if you want the same number every time then before random.ranint() use random.seed() function and inside of the bracket function, pass some random numbers according to your mood, and for this function, you will get the same numbers every time.
random.choice() function randomly choose one value from a random number.The random number can come from an array, list, or random.randint function etc.
random.permutation() function rearrange the index number of the values present in the array.