Note when you don't want to use the standard library copy
Because I don't want to import for just one time
test1.py
list1 = [1, 2, 3]
list2 = list(list1)
test2.py
list1 = [[1, 2, 3], [4, 5, 6]]
list2 = map(list, list1)
test3.py
list1 = [[[1, 2], [3, 4]], [[5, 6], [7, 8] ]
list2 = map(lambda x: map(list, x), list1)
I think that it should be done recursively after the 4th dimension.
You can usually use the deepcopy
of the standard librarycopy
.
Recommended Posts