FunctionRacerProblemsRace

Add Column Offsets

EasyNumPyPython

grid is a 2-D array and offsets is a 1-D array with one number per column. Return a new array where offsets[j] has been added to every cell in column j.

Example 1

grid [[1,2,3],[4,5,6]]
offsets [10,20,30]
returns [[11,22,33],[14,25,36]]

Column 0 gets +10, column 1 gets +20, column 2 gets +30.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems