Q:

Write a NumPy program to append values to the end of an array

0

Write a NumPy program to append values to the end of an array

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
x = [10, 20, 30]
print("Original array:")
print(x)
x = np.append(x, [[40, 50, 60], [70, 80, 90]])
print("After append values to the end of the array:")
print(x)

Sample Output:

Original array:                                                         
[10, 20, 30]                                                            
After append values to the end of the array:                            
[10 20 30 40 50 60 70 80 90]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now