Loading...
Combine multiple arrays using stacking operations.
NumPy provides several stacking functions:
Write a function stack_arrays(arr1, arr2) that combines two 1D arrays.
Return a dictionary with:
arr1 = [1, 2, 3], arr2 = [4, 5, 6]
{'vertical': [[1, 2, 3], [4, 5, 6]], 'horizontal': [1, 2, 3, 4, 5, 6], 'as_columns': [[1, 4], [2, 5], [3, 6]]}vstack creates rows, hstack concatenates, column_stack pairs elements