For a more general solution that works regardless of the number of dimensions, use copy.deepcopy():
import copy
b = copy.deepcopy(a)
For a more general solution that works regardless of the number of dimensions, use copy.deepcopy():
import copy
b = copy.deepcopy(a)