Python Forum
assign a value to a dict change all the values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
assign a value to a dict change all the values
#11
Say you have a container with memory locations (references) in it.

A normal copy (x = y) just copies the memory location of the container.

A shallow copy (x = y[:]) makes a new container, with the memory locations that were in the old container.

A deep copy (x = deepcopy(y)) makes a new container, with new versions of anything that is just a memory location in the old container.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Change row values by other row values from same df JosepMaria 3 2,303 Aug-28-2021, 10:15 PM
Last Post: eddywinch82

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020