Upsampling in Python
I think you are trying to do this:

y = np.zeros(N*len(s))
for i in range(0, len(s)):
    y[i*N] = s[i]

return y


There are other ways in python that avoid explicit loops, for example:

y = [0] * (N * len(s))
y[::N] = s