NumPy - Array Manipulation
If you have two arrays
a = np.array([1, 2]) and b = np.array([3, 4]), what will np.hstack((a, b)) produce?a = np.array([1, 2]) and b = np.array([3, 4]), what will np.hstack((a, b)) produce?a and b are 1D arrays with shape (2,).np.hstack() on 1D arraysnp.hstack() concatenates them into a longer 1D array: [1, 2, 3, 4].15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions