Answers for "np copy into 2d array"

1

copy a 2d array in python

from copy import copy, deepcopy
y = deepcopy(x)
Posted by: Guest on August-17-2021
-2

numpy make 2d array 1d

import numpy as np
  
ini_array1 = np.array([[1, 2, 3], [2, 4, 5], [1, 2, 3]])
  
# printing initial arrays
print("initial array", str(ini_array1))
  
# Multiplying arrays
result = ini_array1.flatten()
  
# printing result
print("New resulting array: ", result)
Posted by: Guest on July-24-2021

Python Answers by Framework

Browse Popular Code Answers by Language