Program to merge two given NumPy arrays of identical shape

In this python numpy program, we will merge two given NumPy arrays of identical shape.

Steps to solve the program
  1. Import the numpy library as np.
  2. Create two identical arrays using np.array().
  3. Merge two given NumPy arrays using np.concatenate().
  4. Print the output.
				
					import numpy as np
x = np.array([1,2,3])
y = np.array([4,5,6])

print("Original arrays:")
print(x)
print(y)

output = np.concatenate((x, y))
print("\nAfter concatenate:")
print(output) 
				
			

Output :

				
					Original arrays:
[1 2 3]
[4 5 6]

After concatenate:
[1 2 3 4 5 6]
				
			

calculate averages without NaNs along a row.

Leave a Comment