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

How to calculate the inverse of a matrix in python using numpy ?

by Benjamin Marchant
Edited: Nov. 1, 2025, 11:58 p.m.

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 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 cluster data from a 2D binary matrix in python ?

by Benjamin Marchant
Edited: May 1, 2023, 3:38 p.m.
Tags: Python; Machine Learning; Clustering;

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 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 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 create a confusion matrix and extract the true and false positives and true and false negatives using scikit learn in python ?

by Benjamin Marchant
Edited: Dec. 9, 2022, 6:58 p.m.
Tags: Python; Scikit Learn; Machine Learning;

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 store a multidimensional matrix in a dataframe with pandas ?

by Benjamin Marchant
Edited: Sept. 17, 2021, 6:31 p.m.
Tags: Python; Pandas; DataFrame;

Public
Thumbnail 1

How to calculate the absolute value of each element of an array or matrix in python with numpy ?

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

Public
Thumbnail 1

How to put data from a CSV file in a matrix in python using numpy ?

by Benjamin Marchant
Edited: May 17, 2021, 8:25 p.m.
Tags: Python; Numpy; CSV;

Public
Thumbnail 1

How to find indices of a given value in a numpy array (or matrix) in python ?

by Benjamin Marchant
Edited: April 13, 2021, 5:18 p.m.
Tags: Python: Numpy; Where;

Public
Thumbnail 1

How to iterate over a row in a numpy array (or 2D matrix) in python ?

by Benjamin Marchant
Edited: April 12, 2021, 1:50 p.m.
Tags: Python; Numpy; Array; Matrix;

Public
Thumbnail 1

How to iterate over a column in a numpy array (or 2D matrix) in python ?

by Benjamin Marchant
Edited: April 12, 2021, 1:31 p.m.
Tags: Python; Numpy; Array; Matrix;

Public
Thumbnail 1

How to add a new column of nan values in an array (matrix) with numpy in python ?

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

Public
Thumbnail 1

How to create a matrix with only NAN values with numpy ?

by Benjamin Marchant
Edited: March 24, 2021, 2:02 a.m.
Tags: Python; Numpy; Matrix;

Public
Thumbnail 1

How to add a new axis to transform a matrix of shape (n,) to (n,1) with numpy in python ?

by Benjamin Marchant
Edited: March 12, 2021, 5:02 a.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to select in a matrix a given index and its neighbors using numpy in python ?

by Benjamin Marchant
Edited: March 10, 2021, 3:24 a.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to find the number of occurrence of matrix element with numpy in python ?

by Benjamin Marchant
Edited: March 2, 2021, 7:16 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to downsample a matrix by keeping only one element every n*n blocks with numpy ?

by Benjamin Marchant
Edited: March 2, 2021, 2:56 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to find indices where values are true in a boolean matrix with numpy in python ?

by Benjamin Marchant
Edited: Feb. 23, 2021, 8:48 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to get the size (e.g. number of elements) of a matrix with numpy in python ?

by Benjamin Marchant
Edited: Dec. 16, 2020, 7:39 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to create and plot a confusion matrix (or crosstab) from two dataframe columns using pandas in python ?

by Benjamin Marchant
Edited: Dec. 16, 2020, 2:23 p.m.
Tags: Python; Pandas; DataFrame;

Public
Thumbnail 1

How to upsample an array (matrix) by repeating elements using numpy in python ?

by Benjamin Marchant
Edited: Nov. 18, 2020, 2:38 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to calculate the determinant of a square matrix with numpy in python ?

by Benjamin Marchant
Edited: Aug. 3, 2020, 1 a.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to find all unique values in a matrix using numpy in python

by Benjamin Marchant
Edited: July 28, 2020, 5:55 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to convert a matrix to a list in python ?

by Benjamin Marchant
Edited: July 27, 2020, 9:22 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to convert a list to a matrix using numpy in python ?

by Benjamin Marchant
Edited: July 27, 2020, 6:47 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to create an empty matrix with numpy in python ?

by Benjamin Marchant
Edited: July 24, 2020, 7:29 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to change array (or matrix) type with numpy in python ?

by Benjamin Marchant
Edited: July 22, 2020, 3:08 a.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to get the type of an array (or matrix) with numpy in python ?

by Benjamin Marchant
Edited: July 21, 2020, 6:22 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to transpose (inverse columns and rows) a matrix using numpy in python ?

by Benjamin Marchant
Edited: July 21, 2020, 4:32 p.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to apply a logarithm to a matrix with numpy in python ?

by Benjamin Marchant
Edited: July 18, 2020, 3:51 a.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to create a constant matrix in python with numpy ?

by Benjamin Marchant
Edited: July 15, 2020, 3:46 a.m.
Tags: Python; Numpy;

Public
Thumbnail 1

How to create a matrix of complex numbers in python using numpy ?

by Benjamin Marchant
Edited: Nov. 15, 2019, 9:07 p.m.

Public
Thumbnail 1

How to prepend an n-by-1 column of ones to a matrix in python using numpy ? (machine learning)

by Benjamin Marchant
Edited: Nov. 14, 2019, 4:14 p.m.
Tags: Machine learning; Python; Linear regression;

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