I have the following code that overwrites matrix rows and it takes a considerable time for large matrices. Basically, I need the rows where there is a value of i to contain that value, while the rest should remain zeros
Any suggestions on how to perform the same operation in a more efficient way?
matr = np.zeros((178858, 400))
for key, index in values.items():
vect = get_vector(key)
matr[index] = vect
get_vector returns a vector of length 400, given a key.
values is a dictionary containing a key (string) and an index (integer) for that key.
valueslook like (don't post the whole thing, just a few pairs)? - FHTMitchellget_vectorthen? - FHTMitchell