• Skip to secondary menu
  • Skip to main content
  • Skip to primary sidebar

Python and R Tips

Learn Data Science with Python and R

  • Home
  • Python
  • Pandas
    • Pandas 101
  • tidyverse
    • tidyverse 101
  • R
  • Linux
  • Conferences
  • Python Books
  • About
    • Privacy Policy
You are here: Home / Archives for Numpy Tips

Numpy Tips

How to Compute Euclidean distance in Numpy

December 26, 2022 by cmdlinetips

In this post, we will learn how to compute Euclidean distance between two points in 2-dimension and also in 3-dimension using Numpy. Euclidean distance is one of the most commonly used distance measure and it is defined as the straight-line distance between two points in Euclidean space. Euclidean distance is calculated as the square root […]

Filed Under: Euclidean distance, Numpy Tips Tagged With: Euclidean distance Numpy, linalg.norm Numpy

How to generate random numbers from Poisson distribution with Numpy

December 26, 2022 by cmdlinetips

In this post, we will learn how to use Numpy’s Random Generator class to generate random numbers sampled from Poisson distribution using poisson function in Numpy. The Poisson distribution is a discrete probability distribution that expresses the probability of a given number of events occurring in a fixed interval of time or space satisfying two […]

Filed Under: Numpy Tips, Python, Python Tips Tagged With: poisson function Numpy

How to generate random numbers from Normal distribution in Numpy

December 26, 2022 by cmdlinetips

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 […]

Filed Under: Numpy Tips, Python, Python Tips Tagged With: Numpy normal() function

How to Randomly permute Numpy Array

December 26, 2022 by cmdlinetips

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 […]

Filed Under: Numpy Tips, Python, Python Tips Tagged With: Numpy permutation(), Numpy permute matrix

Generate Random Integers using Generators in Numpy

December 25, 2022 by cmdlinetips

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 […]

Filed Under: Numpy Tips, Python, Python Tips Tagged With: Numpy default_rng(), Numpy random integers

  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • Go to Next Page »

Primary Sidebar

Subscribe to Python and R Tips and Learn Data Science

Learn Pandas in Python and Tidyverse in R

Tags

Altair Basic NumPy Book Review Data Science Data Science Books Data Science Resources Data Science Roundup Data Visualization Dimensionality Reduction Dropbox Dropbox Free Space Dropbox Tips Emacs Emacs Tips ggplot2 Linux Commands Linux Tips Mac Os X Tips Maximum Likelihood Estimation in R MLE in R NumPy Pandas Pandas 101 Pandas Dataframe Pandas Data Frame pandas groupby() Pandas select columns Pandas select_dtypes Python Python 3 Python Boxplot Python Tips R rstats R Tips Seaborn Seaborn Boxplot Seaborn Catplot Shell Scripting Sparse Matrix in Python tidy evaluation tidyverse tidyverse 101 Vim Vim Tips

RSS RSS

  • How to convert row names to a column in Pandas
  • How to resize an image with PyTorch
  • Fashion-MNIST data from PyTorch
  • Pandas case_when() with multiple examples
  • An Introduction to Statistical Learning: with Applications in Python Is Here
  • 10 Tips to customize ggplot2 title text
  • 8 Plot types with Matplotlib in Python
  • PCA on S&P 500 Stock Return Data
  • Linear Regression with Matrix Decomposition Methods
  • Numpy’s random choice() function

Copyright © 2025 · Lifestyle Pro on Genesis Framework · WordPress · Log in

Go to mobile version