Skip to main content
Loading page…
Python Mastery
Chapter 40
Lesson 1 of 4
The ndarray
Contents
Notes
Tutor
Concept
Why NumPy? The Case Against Pure Python Loops
Loading activity…
Previous
1 / 10
Continue
Contents
Notes
Discussion
Tutor
28 min
10 activities
0 of 10 done
In this lesson
1
Why NumPy? The Case Against Pure Python Loops
2
Installing NumPy and Creating Your First Arrays
3
dtypes — The Type System Inside NumPy
4
reshape() — Changing Shape Without Copying Data
5
Arrays vs Lists — Side-by-Side Comparison
6
Create a Temperature Grid
7
arange vs linspace
8
Match the Creation Function
9
Gotcha: Integer Division and dtype Surprises
10
reshape() Memory Behaviour
Objectives
Install NumPy and import it with the canonical alias
Create arrays with np.array, np.arange, np.zeros, np.ones, and np.linspace
Inspect and interpret dtype, shape, ndim, and size attributes
Reshape an array without copying its data
Explain why NumPy arrays are faster and more memory-efficient than Python lists for numerical work
Chapter 40 · NumPy: Fast Numerical Computing
The ndarray
Indexing, Slicing & Vectorization
Broadcasting & Aggregation
Linear Algebra & Random
Previous: A Guided Notebook Exploration
Next: Indexing, Slicing & Vectorization