In this post, we will learn how to generate random numbers from normal distribution in Numpy. A normal distribution, also known as the Gaussian distribution, is a continuous probability distribution that is symmetric around the mean, with most of the data points concentrated within three standard deviations of the mean. Normal distribution is one of […]
Python
How to Randomly permute Numpy Array
In this post, we will learn how to permute or randomize a 1D array and 2D Numpy Array using Numpy. We will use Numpy’s Random Generator class to create generator object with default_rng() and use permutaion() function on the object to permute. Let us get started by importing Numpy. The basic syntax of Numpy’s permutation […]
Generate Random Integers using Generators in Numpy
In this post, we will learn how to generate random integers using Random Generators in Numpy Python. Random Generator class in Numpy offers wide variety of random distributions including integers. To get started let us import Numpy To generate random numbers, we need a construcor of random number class Generator. In Numpy, default_rng() is the […]
Computing Correlation with Numpy corrcoef()
In this post, we will learn how to use Numpy’s corrcoef() function to compute correlation between two datasets stored in a list or arrays. Numpy’s corrcoef function calculates pearson correlation coefficient, which is a measure of how two variables are related. The resulting correlation coefficient can range from 1 to -1. A correlation coefficient of […]
Numpy arange() function with examples
In this post, we will learn how to use arange(), one of the most useful functions in Numpy. With Numpy arange function we can create evenly spaced arrays. For example, If you need to create an array of numbers within a given range, you can use the arange function. To get started let us load […]