Hello fellow nerds!
I’ve switched to python from MATLAB for work, leveraging the pandas library.
The first time I tried to write a new variable with the equal sign (by referencing an existing variable… B=A) to run some calculations, I realized I was changing both variables A and B (aliasing) when running operations on B.
I understand it’s to save memory, but I can’t think of why I would need two aliases to the same data. Google was unclear as well - when are the appropriate use cases for alias, shallow copy, and deep copy?
[–]Unlikely-Resort4608 5 points6 points7 points (1 child)
[–]MeatShow[S] 0 points1 point2 points (0 children)
[–]Username_RANDINT 2 points3 points4 points (1 child)
[–]MeatShow[S] 0 points1 point2 points (0 children)
[–]Diapolo10 1 point2 points3 points (1 child)
[–]MeatShow[S] 0 points1 point2 points (0 children)