I get TypeError when using /= on a NumPy array right after creation:
>>> arr = np.array([1,2,3])
>>> arr /= 2
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-89-ff91ab204368> in <module>
----> 1 arr /= 2
TypeError: No loop matching the specified signature and casting
was found for ufunc true_divide
But I can do:
>>> arr = arr / 2
>>> arr
array([0.5, 1, 1.5])
What's weirder, is that after doing the above I can do:
>>> arr /= 2
>>> arr
array([0.25, 0.5, 0.75])
What is happening?