Select Page

## How to Find the Transpose of a Matrix in Python

The transpose of a matrix is a flipped version of the original matrix. We can transpose a matrix by switching its rows with its columns. We widely use the transpose of the matrix in linear algebra, physics, and computer science. This tutorial will go through how to...

## How to Find the Factorial of a Number in Python

The factorial of a positive integer n is the multiplication operation of all integers smaller than or equal to n. The notation of the factorial is the exclamation mark, n!. For example, the factorial of 5 is: 5! = 5 * 4 * 3 * 2 * 1 = 120 This tutorial will go through...

## How to Calculate the Cartesian Product in Python

The Cartesian product of two sets A and B denoted A x B is the set of all possible ordered pairs (a, b), where a is in A and b is in B. We can get the Cartesian product between two lists saved as a 2D list in Python. This tutorial will go through different methods to...

## How to Calculate the Manhattan Distance in Python

Distances measures are essential tools for machine learning. A distance measure is a score that summarises how different two objects are in the problem domain. Usually, we calculate distance measures on rows of data, like strings representing text documents. Specific...