Operating with Python objects in a heavy loop like that, whether they are float, np.float32, is always slow. NumPy is fast for operations on vectors and matrices, because all of the operations are performed on big chunks of data by parts of the library written in C, and not by the Python interpreter. Code run in the interpreter and/or using Python objects is always slow, and using non-native types makes it even slower. That's to be expected.

If your app is slow and you need to optimize it, you should try either converting your code to a vector solution that uses NumPy directly, and is fast, or you could use tools such as Cython to create a fast implementation of the loop in C.

numpy float: 10x slower than builtin in arithmetic operations?
In msh210's answer to this question of mine, he stated that:


  women...who physically could be [intimate with men], which is those who had reached their third birthday.


In comments, he mentioned that:


  age three is the age at which a girl is halachically considered to be physically able to have intercourse.


Could you explain why and where this comes from? Keep in mind I am not Jewish, so if it specific to some non-OT writings, please explain those as well.
