Which numpy operations copy and which mutate?
问题 Is there a general rule of thumb for knowing which operations on a numpy.ndarray produce a copy of the values and which mutate them in-place? I'm pretty new to numpy and I'm sure I'll learn the hard way eventually, but I was wondering if there were general principles driving mutability that might help speed my learning. 回答1: Functions that mutate in place Relatively few numpy functions mutate in place. For the most part, numpy functions return array views when they can, and copies when they