# Python program explaining
# vstack() function
import numpy as geek
# input array
in_arr1 = geek.array([ 1, 2, 3] )
print ("1st Input array :
", in_arr1)
in_arr2 = geek.array([ 4, 5, 6] )
print ("2nd Input array :
", in_arr2)
# Stacking the two arrays vertically
out_arr = geek.vstack((in_arr1, in_arr2))
print ("Output vertically stacked array:
", out_arr)
# welcome to softhunt.net
# Python program explaining
# vstack() function
import numpy as np
# input array
in_arr1 = np.array([[0, 1, 3], [-0, -1, -3]] )
print ("1st Input array :
", in_arr1)
in_arr2 = np.array([[5, 7, 9], [-5, -7, -9]] )
print ("2nd Input array :
", in_arr2)
# Stacking the two arrays vertically
out_arr = np.vstack((in_arr1, in_arr2))
print ("Output stacked array :
", out_arr)
# welcome to softhunt.net
# Python program explaining
# hstack() function
import numpy as np
# input array
in_arr1 = np.array([0, 1, 3] )
print ("1st Input array :
", in_arr1)
in_arr2 = np.array([5, 7, 9] )
print ("2nd Input array :
", in_arr2)
# Stacking the two arrays horizontally
out_arr = np.hstack((in_arr1, in_arr2))
print ("Output horizontally stacked array:
", out_arr)