Numerical computation in Python often starts with NumPy. This chapter introduces the NumPy N-dimensional array, or ndarray
, the fundamental object for efficient array operations. You will learn how to create these arrays, both from standard Python lists and using specialized NumPy functions designed for generating arrays with specific characteristics, such as arrays filled with zeros or sequences of numbers.
We will cover the different data types NumPy arrays can hold and why specifying the correct type (dtype) is important for performance and memory usage. You'll also learn how to inspect the basic attributes of an array, such as its dimensions (ndim
), shape (shape
), and the total number of elements (size
). By the end of this chapter, you will be comfortable creating and examining the basic properties of NumPy arrays, preparing you for subsequent manipulation and computation tasks.
2.1 Understanding NumPy N-dimensional Arrays
2.2 Creating Arrays from Python Lists
2.3 Built-in Array Creation Functions
2.4 Understanding Array Data Types
2.5 Basic Array Attributes
2.6 Hands-on practical: Creating and Inspecting Arrays
© 2025 ApX Machine Learning