Closed cmichelenstrofer closed 2 years ago
The calculation of B
can be taken out of the for loop, it is time consuming and does not require mcol
.
Speed up by:
B = np.outer(time_index, omega)
instead of
from itertools import product as _product
B = np.array([x*y for x,y in _product(time_index, omega)])
and
C = np.cos(B+phase[eta.columns[0]])
instead of
C = np.real(np.exp(1j*(B+phase[mcol])))
is about 20 times slower than