A list of lists is usually not a great solution for creating a 2d array. You probably want to use numpy, which provides a very useful, efficient n-dimensional array type. numpy arrays can be copied.
Other solutions that are usually better than a simple list of lists include dict with tuples as keys ( d[1, 1] will be component 1, 1) or define your own 2d array class. Of course, dicts can be copied, and you can ignore copying for your class.
To copy the list of lists, you can use copy.deepcopy , which when copying will go one level.
source share