My program needs to find the product of all the terms in a vector save for one row i, which is determined by a for loop. The numpy.delete function will not accept i as an input, only a number. Is there a workaround for this?
Example:
for i in range(some_range):
arr=[some vector]
section=np.delete(arr,i,axis=0)
return prod(section)
This returns a ValueError: invalid entry message. The code works fine when I replace the i with 1. Is there any way to perform this operation while retaining the for loop?
returninside the loop, it will only run once (making the loop pointless).