I guess that iterating over an numpy array is not the most efficient way, and I can see that my program is really slow now that I have a bit larger dataset.
1) What is the go to way to iterate over a matrix and apply a function to each cell?
This is part of the code:
# States and data are two lists with a few appended items ~100
rows = len(self.states)
cols = len(self.data)
self.trellis = np.zeros((rows, cols))
for i, state in enumerate(self.states):
for j, vector in enumerate(self.data):
self.trellis[i][j] = mvnun_wrapper(vector, state.mu, state.sigma, vector_length)