Minor style edits
Like you said, the code seems to be perfectly fine and I don't see a very obvious way to make it faster or more efficient, as the consecutive computations you are making in your
for loop don't seem to be easy to relate to one another.
Of course this is just my input after thinking for some time, other people may have clever suggestions I can't come up with.
However, I would make minor edits to your code, for the sake of homogenisation:
x = np.zeros(Zs.shape)
for i in range(len(Zs)):
x[i] = np.mean((Zs[i:] - Zs[:-i])**2)
For the snippet of code we have, it is not clear the relationship between
Zs and so it makes more sense to have the loop in terms of
Also, notice that the right term of the subtraction I replaced
Zs[:-i], which is a nice feature of Python that is worth getting used to, you can learn about using negative indices in Python.
Other minor things were just fixing spacing. If you want, take a look at the PEP 8 style guide for Python :)