Add np.array([100, 200, 300]) down the rows of a — so row 0 gains 100, row 1 ga…

NumPy · from Broadcasting

shape rulesnp.newaxisouter operationsValueError

Putting the kettle on…

Starting up…

Exercise 2

Add np.array([100, 200, 300]) down the rows of a — so row 0 gains 100, row 1 gains 200, row 2 gains 300.

your answer
stuck? the lesson behind it
Broadcasting
How NumPy makes mismatched shapes work — without copying anything.