Numpy – How to get an array of the pattern gamma^t for some 0-t?

I am creating a basic gridworld RL problem and I need to calculate the return for some given episode. I currently have the array of rewards, and I would like to element-wise multiply this with a list of the form: [gamma**0, gamma**1, gamma**2, ….] In order to get: [r_0*gamma**0, r_1*gamma**1, r_2*gamma**2, ….] and then use… Read More Numpy – How to get an array of the pattern gamma^t for some 0-t?