For example, if we have a numpy
array A
, and we want a numpy
array B
with the same elements.
What is the difference between the following (see below) methods? When is additional memory allocated, and when is it not?
B = A
B[:] = A
(same as B[:]=A[:]
?)
numpy.copy(B, A)
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…