June 2018
Beginner to intermediate
168 pages
3h 40m
English
So far, we have worked with two arrays with equal shape. In fact, this is not necessary. While we cannot necessarily add two arrays of any shape, there are situations where we can reasonably perform an arithmetic operation on arrays of different shapes. In some sense, information in a smaller array is treated as if it belongs to an array of equal shapes, but with repeated values. Let's see some of this broadcasting behavior in action.
Now, recall that the array arr1 is 3 x 3 x 3; that is, it has three rows, three columns, and three slabs. Here, we create an object, arr3:

This object has the shape (1, 1, 3). So, this object has ...
Read now
Unlock full access