Python is useful for many things, but in trying to be simple it’s also terrible in several ways.
- typing. For numpy arrays, if we have an int array then adding a float to an element of the array will automatically be floored. So operations on individual elements of the array are casted to the original type of the array. Each np.array has exactly one type for all of its elements. So for calculation, always initialize as floats.
- It can be confusing whether two variables point to the same data or different data. To be sure, initially the variable temp =  or something like it.