FunctionRacerProblemsRace

Rows of Width

EasyNumPyPython

Cut arr into rows of w numbers each and return the resulting 2-D array (fill row 0 first, then row 1, and so on). len(arr) is always a multiple of w.

Example 1

arr [1,2,3,4,5,6]
w 3
returns [[1,2,3],[4,5,6]]

The rows are [1, 2, 3] and [4, 5, 6].

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