Creating NumPy Arrays

Introduction

Every NumPy workflow begins with getting data into an array. Sometimes that data already exists as a Python list or tuple and simply needs converting; more often, you need to generate it — a time vector for a simulation, a grid of sample points for plotting a function, a matrix of zeros to accumulate results, an identity matrix for a linear algebra step, or random values for a Monte Carlo trial. NumPy provides a dedicated creation function for each of these cases, and choosing the right one makes your code shorter, faster, and easier to read.

In this course, array creation is the foundation everything else rests on. The vectorized arithmetic, indexing, linear algebra, and statistics you will use later all assume you can produce arrays of the right shape and data type to begin with. Pay particular attention to the distinction between np.arange(), which is defined by a step size and excludes the endpoint, and np.linspace(), which is defined by a count of points and includes the endpoint — this difference causes a large share of beginner errors in engineering scripts.

As you watch, keep a few questions in mind: What arguments does each function take, and what does it return? What is the dtype of the resulting array, and when does that matter? How do the shape and reshape operations relate to the number of elements? Try typing each example into your own Python session and then changing one argument at a time to see what happens.

Video 1: Numpy Tutorial #1 - Create Arrays (Python for Data Science)

The Morpheus Tutorials · 13:20 · 36,036 views · 5y ago · captions — Watch on YouTube

About this video

An introductory tutorial on creating NumPy arrays, opening a longer Python-for-data-science playlist. Based on its title and position in the series, it should cover importing NumPy, building arrays from Python lists and nested lists, and inspecting basic attributes such as shape and data type. Expect the pace of a first-contact lesson, with code typed out and explained line by line.

Why this video

It directly addresses the 'Creating Arrays from Python Sequences' subtopic and gives you the vocabulary (array, shape, dtype) that the remaining videos assume. As the first entry in an established tutorial series, it is pitched at exactly the level of someone meeting NumPy for the first time.

Video 2: How to Create Numpy Arrays Using Numpy Functions ( arange(), zeros(), ones(), full() and reshape())

WsCube Tech! ENGLISH · 12:52 · 4,625 views · 3y ago · captions — Watch on YouTube

About this video

A focused walkthrough of NumPy's built-in generator functions: arange() for evenly spaced sequences by step, zeros(), ones(), and full() for constant-value initialization, and reshape() for changing the layout of an existing array. The description indicates each function is demonstrated with concrete code examples.

Why this video

This is the closest match to the 'Range' and 'Constant-Value Initialization Functions' subtopics, and the inclusion of reshape() helps you connect the number of elements an array holds to the shape it can take.

Video 3: Numpy Tutorial #14 - More ways to create arrays (Python for Data Science)

The Morpheus Tutorials · 8:10 · 2,465 views · 5y ago · captions — Watch on YouTube

About this video

A later episode in the same series that gathers additional array-creation techniques beyond the basic np.array() call. Given its title and placement, it likely surveys functions such as linspace, identity or eye, and random generation, showing when each is the natural choice.

Why this video

It fills in the remaining subtopics — linspace, identity and diagonal matrices, and random arrays — and reinforces the idea that NumPy offers a specialized constructor for each common pattern rather than requiring loops.

How These Videos Support the Learning Outcomes

Together these three videos cover the construction functions named in MO1: converting Python sequences with np.array(), generating evenly spaced values with np.arange() and np.linspace(), filling arrays with zeros(), ones(), and full(), and producing identity and random arrays. They also build the shape and dtype awareness you will need downstream — broadcasting in MO2 depends on understanding array shapes, indexing in MO3 depends on knowing how arrays are laid out, the linear algebra work in MO4 frequently starts from an identity or zero matrix, and the statistical and function-evaluation tasks in MO5 typically begin with a linspace-generated input range.

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.