November 2017
Intermediate to advanced
374 pages
10h 19m
English
array_1 + 1array([[ 1, 2], [ 3, 4], [ 5, 6], [ 7, 8], [ 9, 10]])
The term broadcasting refers to the smaller array being stretched or broadcast across the larger array. In the first example, the scalar 1 was stretched to a 5 x 2 shape and then added to array_1.
array_2 = np.arange(10)array_2 * array_2array([ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81])
Read now
Unlock full access