Advanced Mathematical Operations
Generating numerical arrays is a fairly common task. So far, we have been doing this by creating a Python list object and then converting that into a NumPy
array. However, we can bypass that and work directly with native NumPy methods. The arange
function creates a series of numbers based on the minimum and maximum bounds you give and the step size you specify. Another function, linspace
, creates a series of fixed numbers of the intermediate points between two extremes.
In the next exercise, we are going to create a list and then convert that into a NumPy
array. We will then show you how to perform some advanced mathematical operations on that array.
Exercise 3.04: Advanced Mathematical Operations on NumPy Arrays
In this exercise, we'll practice using all the built-in mathematical functions of the NumPy
library. Here, we are going to be creating a list and converting it into a NumPy
array. Then, we will perform some advanced mathematical...