Q:

Write a NumPy program to copy data from a given array to another array

0

Write a NumPy program to copy data from a given array to another array.

All Answers

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

import numpy as np
x = np.array([24, 27, 30, 29, 18, 14])
print("Original array:")
print(x)
y = np.empty_like (x)
y[:] = x
print("\nCopy of the said array:")
print(y)

Sample Output:

Original array:
[24 27 30 29 18 14]

Copy of the said array:
[24 27 30 29 18 14]

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