Quantcast
Channel: Why does operating on what seems to be a copy of data modify the original data? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Batman for Why does operating on what seems to be a copy of data modify the original data?

$
0
0

The key point here is

Advanced indexing always returns a copy of the data

In your second example you're not using the index to return anything. You're only using the index to modify the values. So the object that you're modifying is the original object. Not the copy.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>