Start studying
Module 2 · Maths for Data Module contents
Module 2  ·  Card 7 / 13beginner

Matrices

A matrix is a two-dimensional rectangular array of numbers arranged into horizontal rows and vertical columns.

Its size is described by its dimensions, written as rows by columns, such as a four-by-three matrix.

In data science, a matrix naturally stores an entire dataset where each row is an entity and each column is a feature.

For example, records of five students with scores across three exams can be stored as a five-by-three matrix.

Matrices allow computers to store tabular numbers efficiently and apply algebraic operations across entire collections of data.

Learn in depth ↓
Module 02 · Maths for Data · 13 concepts
In depth  /  15 lines

Matrices, in more detail

Matrices provide the compact mathematical structure used to represent and manipulate tabular data at scale.

A matrix organises numerical entries into an indexed two-dimensional rectangular grid.

The dimensions are universally specified as m rows by n columns, where m and n are positive integers.

An individual entry inside matrix A is denoted by a lowercase letter with subscripts i and j for its row and column.

A matrix with an equal count of rows and columns is called a square matrix, such as three by three.

A matrix containing only a single column is equivalent to a column vector, while one row forms a row vector.

In statistical computing, the central data table is commonly arranged as an m-by-n design matrix.

Each row in the design matrix represents an individual observed sample or experimental trial.

Each column represents a distinct numeric variable or measured property recorded across all samples.

Matrices of identical dimensions can be added or subtracted together element by element.

Multiplying a matrix by a scalar scales every internal entry by that constant, preserving its grid dimensions.

A common beginner trap is confusing the row-by-column dimension order, accidentally reading columns before rows.

Transposing this convention leads to dimension mismatch errors when feeding matrices into mathematical algorithms.

Special configurations include diagonal matrices, where all entries outside the main diagonal are zero.

Viewing tabular datasets as matrices allows algorithms to execute operations across millions of values simultaneously.

Want the full technical article? Wikipedia ↗
Test yourself

One question on this card. Every option explains itself once you pick, right or wrong.

Question 1
A dataset records measurements on 100 patient visits across 4 clinical tests. What are the dimensions of this data matrix?
Maths for Data

13 concepts in this module, then a graded test with every answer explained.

Study this module →
↑↓ move↵ openesc close