Answers for "deep copy 2d array in python"

1

copy a 2d array in python

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

python create 2d array deep copy

# This is assuming that it is a matrix
newArr = [[arr[i][j] for i in range(len(arr))] for j in range(len(arr[0]))]
Posted by: Guest on October-11-2021

Python Answers by Framework

Browse Popular Code Answers by Language