Answers for "Python NumPy column_stack Function Example with 2d array"

0

Python NumPy column_stack Function Example with 2d array

# welcome to softhunt.net
# Python program explaining
# column_stack() function

import numpy as np

# input array
in_arr1 = np.array([[0, 1, 3], [-0, -1, -3]] )
print ("1st Input array : \n", in_arr1)

in_arr2 = np.array([[5, 7, 9], [-5, -7, -9]] )
print ("2nd Input array : \n", in_arr2)

# Stacking the two arrays
out_arr = np.column_stack((in_arr1, in_arr2))
print ("Output stacked array :\n ", out_arr)
Posted by: Guest on April-24-2022

Python Answers by Framework

Browse Popular Code Answers by Language