Tools 1.2Lesson outlineLesson 2 of 7 in Module 1
Shape, dtype and Reshaping
Read any array's shape and dtype, and reshape without copying.
Free sample. Everything in this module opens with a free account.Video in production.
Lesson outline: Shape, dtype and Reshaping
In this lesson7 parts
- 01Loading an array, and reading its shape
- 02Reshaping to a grid: shape, ndim, size and len
- 03Reshape changes the reading, not the buffer
- 04dtype, itemsize and nbytes
- 05Fixed width: int8, astype and silent wraparound
- 06Creating arrays without data: zeros, ones, arange and linspace
- 07Recap and your challenge
Key terms: Shape, dtype and Reshaping
The words this lesson introduces, each in one line. The module’s glossary collects them all, and the AI glossary has every term across the courses.
- Shape
- Element count on each axis, as a tuple
- Dimension /
ndim - An axis / the number of axes
dtype- The type and width used for array elements
- Reshape
- Interpret the same number of elements with a new shape; a copy is possible for non-contiguous inputs
Quiz: Shape, dtype and Reshaping
Your first pick on each question is the one that counts. Getting one wrong here is how the lesson sticks.