+ 1
Delete on a copy of a copy 2D dictionnary
When I delete an element from a copy of 2D dictionnary, i realise that this delete was done also on.the original 2D dictionnary, but with dictionnary of 1D dictionnary i don t have this issue. Look at the code bellow https://code.sololearn.com/cx7pHL45W70g/?ref=app
2 Answers
+ 4
You can use copy.deepcopy method to fix this problem with multidimensional iterables:
import copy
net1copy=copy.deepcopy(net1)
net2copy=copy.deepcopy(net2)
+ 1
Thanks Seb for your help, i had imported copy and applicate the method copy.deepcopy, and now it is functionning