Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python NumPy append Function Example Appending arrays

# welcome to softhunt.net
# Python Program illustrating
# numpy.append()

import numpy as np

#Working on 1D
arr1 = np.arange(5)
print("1D arr1 : ", arr1)
print("Shape : ", arr1.shape)


arr2 = np.arange(8, 12)
print("
1D arr2 : ", arr2)
print("Shape : ", arr2.shape)


# appending the arrays
arr3 = np.append(arr1, arr2)
print("
Appended arr3 : ", arr3)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #NumPy #append #Function #Example #Appending #arrays
ADD COMMENT
Topic
Name
8+1 =