Numpy Functions

Introduction

NumPy is more than a container for numbers: it ships with a large library of ready-made functions that do the heavy lifting of engineering computation. These fall into a few families you will use again and again: mathematical and arithmetic functions (element-wise addition, powers, exponentials, trigonometry), statistical functions (mean, median, standard deviation, min/max, sums along an axis), linear algebra functions in numpy.linalg (matrix multiplication, determinants, inverses, solving Ax = b, eigenvalues), array manipulation functions (reshape, transpose, concatenate, stack, split), sorting and searching functions (sort, argsort, argmax, where, searchsorted), and input/output functions for loading and saving data (loadtxt, genfromtxt, save, savetxt).

This matters in EGN3214 because engineering problems usually arrive as tables of measurements or systems of equations, not as single scalars. Writing Python loops over thousands of sensor readings is slow and error-prone; calling a vectorized NumPy function on the whole array is one line, far faster, and much closer to the mathematical notation you already use in statics, circuits, and thermodynamics.

As you watch the videos below, pay attention to three things: (1) the distinction between element-wise operations (the * operator) and true matrix operations (np.dot, the @ operator, or numpy.linalg routines) — this is the single most common source of bugs; (2) how shapes and axes control what a function returns, especially for statistics computed along rows versus columns; and (3) when a problem outgrows NumPy and is better handled by a specialized library such as SciPy. Keep a notebook open and retype the examples rather than only watching.

Video 1: Numpy Arrays - Fast Linear Algebra in Python

Socratica · 14:10 · 17,205 views · 6mo ago · captions — Watch on YouTube

About this video

A broad introduction to NumPy arrays with an emphasis on linear algebra, from the Socratica channel. Expect coverage of how arrays are created and shaped, how arithmetic on arrays is vectorized, and how NumPy performs matrix operations such as products, inverses, and solving systems quickly compared with plain Python.

Why this video

Socratica is a well-regarded producer of concise, carefully scripted Python tutorials, and this video connects the mathematical and arithmetic function family directly to the linear algebra subtopic in a single clear narrative.

Video 2: DS - ML Tutorial 21. Arithmetic and Linear Algebra Operations with NumPy

Demystify with Ajay · 19:36 · 1,395 views · 3y ago · captions — Watch on YouTube

About this video

A longer, worked tutorial that walks through arithmetic operations on NumPy arrays and then moves into linear algebra operations. The pace allows for live demonstration of the operations in code, so you can see the syntax, the printed output, and the difference between element-wise and matrix-level computation.

Why this video

At roughly twenty minutes it gives more hands-on screen time than a short overview, making it a good follow-along companion for practicing the arithmetic and numpy.linalg functions yourself.

Video 3: SciPy - A Scientific Extension of NumPy | Python

Socratica · 10:01 · 11,771 views · 6mo ago · captions — Watch on YouTube

About this video

An overview of SciPy, the collection of scientific modules built on top of NumPy arrays. The video introduces what SciPy adds beyond NumPy — specialized routines for areas such as optimization, integration, interpolation, signal processing, and advanced linear algebra — and shows how SciPy functions consume and return ordinary NumPy arrays.

Why this video

It sets the boundary of the topic: once you know NumPy's built-in function families, this clarifies which engineering tasks reach past them, and it reinforces that the NumPy array remains the common data structure across the scientific Python stack.

How These Videos Support the Learning Outcomes

Together these videos reinforce the module outcomes. The Socratica array video and the Demystify with Ajay tutorial both demonstrate array creation and shaping (MO1) and vectorized element-wise arithmetic across arrays without Python loops (MO2), while their indexing and slicing examples support selecting subsets of data (MO3). Their linear algebra segments map directly onto solving systems of equations and computing eigenvalues with numpy.linalg (MO4), and the array-wide mathematical and statistical functions shown — sums, means, trigonometric and power functions applied to whole arrays — underpin characterizing engineering data (MO5). The SciPy video extends the picture, showing where NumPy's function library hands off to more specialized scientific routines, which is useful context as you choose the right tool for a given computation.

About These Videos

These videos were chosen from YouTube on October 2, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.