MOONBOOKS
  • Notes
  • Projects
  • Courses
  • Videos
  • Datasets
  • Version
    • English
    • French
  • Sign-In
Join-Us
Notes Articles Jupyter PDF
Thumbnail 1

How to Duplicate and Repeat a 1D Column Array Along the Y-Axis with NumPy

by Benjamin Marchant
Edited: Dec. 14, 2024, 5:09 p.m.

Public
Thumbnail 1

How to Fill Values in an Array Between Two Index Arrays Using NumPy ?

by Benjamin Marchant
Edited: Dec. 14, 2024, 2:57 p.m.

Public
Thumbnail 1

How to generate and plot random numbers from a normal (Gaussian) distribution using python and matplotlib ?

by Benjamin Marchant
Edited: Feb. 12, 2024, 10:39 p.m.
Tags: Python; Numpy; Random numbers;

Public
Thumbnail 1

How to shift elements in a numpy array ?

by Benjamin Marchant
Edited: Feb. 2, 2024, 12:39 a.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to find the minimum value in each row of a numpy array ?

by Benjamin Marchant
Edited: Jan. 21, 2024, 4:31 a.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to create a distance matrix from two numpy arrays of points ?

by Benjamin Marchant
Edited: Jan. 19, 2024, 1:52 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to calculate the sum of all elements in a numpy matrix ?

by Benjamin Marchant
Edited: Jan. 10, 2024, 8:17 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to change the shape of a numpy array ?

by Benjamin Marchant
Edited: Jan. 4, 2024, 1:43 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to efficiently apply a function element-wise to multiple NumPy arrays ?

by Benjamin Marchant
Edited: Jan. 2, 2024, 3:45 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to save and compress a numpy array efficiently ?

by Benjamin Marchant
Edited: Dec. 28, 2023, 8:50 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to stack two numpy arrays in python ?

by Benjamin Marchant
Edited: Dec. 11, 2023, 2:10 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to only keep the maximum value of two numpy arrays ?

by Benjamin Marchant
Edited: Dec. 8, 2023, 8:25 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to find the most frequent value or mode in a numpy array ?

by Benjamin Marchant
Edited: Dec. 6, 2023, 3:38 a.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to calculate the element-wise mean across multiple numpy arrays in Python ?

by Benjamin Marchant
Edited: Dec. 2, 2023, 2:16 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to invert the elements of a numpy boolean array in python ?

by Benjamin Marchant
Edited: Sept. 20, 2023, 4:40 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to remove rows from a numpy array in python ?

by Benjamin Marchant
Edited: Sept. 18, 2023, 3:13 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to remove rows from a numpy array based on a condition in python ?

by Benjamin Marchant
Edited: Sept. 17, 2023, 10:22 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to downsample a matrix by averaging elements n*n with numpy in python ?

by Benjamin Marchant
Edited: June 20, 2023, 2:01 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to save a numpy 2D array in a text file in python ?

by Benjamin Marchant
Edited: June 5, 2023, 6:46 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to replace nan value with zero using numpy ?

by Benjamin Marchant
Edited: May 16, 2023, 11:38 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to import and rotate an image using matplotlib ?

by Benjamin Marchant
Edited: May 15, 2023, 6:07 p.m.
Tags: Python; Scipy; Matplotlib; Image; Numpy;

Public
Thumbnail 1

How to check if any row in a numpy array contains negative values ?

by Benjamin Marchant
Edited: April 13, 2023, 7:22 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to apply a function to the values of a column array using numpy ?

by Benjamin Marchant
Edited: April 8, 2023, 1:52 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to calculate and plot the inverse cosine in python ?

by Benjamin Marchant
Edited: March 28, 2023, 2:46 a.m.
Tags: Python; Math; Numpy;

Public
Thumbnail 1

How to generate random numbers from a gamma distribution with python ?

by Benjamin Marchant
Edited: March 23, 2023, 8:08 p.m.
Tags: Python; Numpy; Scipy;

Public
Thumbnail 1

How to normalize each row of an array into percentages with numpy ?

by Benjamin Marchant
Edited: March 19, 2023, 5:25 p.m.
Tags: Python; Numpy; Normalization;

Public
Thumbnail 1

How to slice a multidimensional matrix on column values with numpy ?

by Benjamin Marchant
Edited: March 13, 2023, 7:10 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to determine the nearest value and its index in an array using numpy ?

by Benjamin Marchant
Edited: March 13, 2023, 4:38 p.m.

Public
Thumbnail 1

How to randomly insert NaN in a matrix with numpy in python ?

by Benjamin Marchant
Edited: Feb. 24, 2023, 4:12 a.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to round all the elements of a matrix with numpy in python ?

by Benjamin Marchant
Edited: Feb. 21, 2023, 4:25 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to always generate the same random numbers with numpy ?

by Benjamin Marchant
Edited: Feb. 21, 2023, 4:02 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to generate a matrix of random floats with numpy ?

by Benjamin Marchant
Edited: Feb. 19, 2023, 2:30 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to evaluate and plot a 2D function in python ?

by Benjamin Marchant
Edited: Dec. 9, 2022, 7:38 p.m.
Tags: Python; Numpy; Function; Meshgrid;

Public
Thumbnail 1

How to pad a numpy array in python ?

by Benjamin Marchant
Edited: Dec. 9, 2022, 7:04 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to add a border (frame) to an image using python ?

by Benjamin Marchant
Edited: Dec. 9, 2022, 7:03 p.m.
Tags: Python; Numpy; Image;

Public
Thumbnail 1

How to create a matrix of random numbers with numpy in python ?

by Benjamin Marchant
Edited: Sept. 28, 2021, 9:41 p.m.
Tags: Python; Numpy; Random;

Public
Thumbnail 1

How to convert a matrix of floats into a matrix of integers with numpy in python ?

by Benjamin Marchant
Edited: Sept. 21, 2021, 6 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to calculate the mean along a given axis with numpy in python ?

by Benjamin Marchant
Edited: Sept. 19, 2021, 3:02 a.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to calculate the sum along an axis with numpy in python ?

by Benjamin Marchant
Edited: Sept. 19, 2021, 2:24 a.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to calculate the Pearson’s Correlation coefficient between two datasets in python ?

by Benjamin Marchant
Edited: Sept. 16, 2021, 7:39 p.m.
Tags: Python; Numpy; Scipy;

Public
  • 1
  • 2
  • 3
Copyright © 2025 - All rights reserved Contact Us Terms & Conditions