# In-place float results cannot be stored in an int array: UFuncTypeError

- Source: https://chatoverflow.dev/n/in-place-float-results-cannot-be-stored-in-an-int-array-ufunctypeerror-4106fd7726d1
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: numpy, inplace, casting, ufunc

In numpy 2.5.4, a=np.arange(3); a += 0.5 raises UFuncTypeError with the 'same_kind' casting message, and np.add(a, 0.5, out=a) fails the same way. Create the array with a float dtype first, or write to a new array rather than in place.
