2 ms·
Python: >>> import numpy >>> numpy.array([1,2,3]) + numpy.array([4,5,6]) array([5, 7, 9]) Python sequences use "+" for concatenation, but numpy ar
by Animats 11y ago
Python:
>>> import numpy
>>> numpy.array([1,2,3]) + numpy.array([4,5,6])
array([5, 7, 9])
Python sequences use "+" for concatenation, but numpy arrays use them for addition. (This is why language designers should not use "+" for concatenation. The mixed-mode semantics get very strange.).