Side by Side Columns
a and b are two 1-D arrays of the same length. Return a 2-D array with two columns: the first column is a and the second column is b. Hint: np.column_stack.
Example 1
a [1,2,3]
b [7,8,9]
returns [[1,7],[2,8],[3,9]]
The rows are [1, 7], [2, 8] and [3, 9].
Constraints
1 <= len(a) = len(b) <= 50
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Sign of EachBeginner
- Sorted DistinctBeginner
- Standard DeviationBeginner
- Swap Rows and ColumnsBeginner
- Third QuartileBeginner
- Votes TallyBeginner
- Add Column OffsetsEasy
- Age GroupsEasy