The problem is you are trying to call ma function on a series object which is not possible, but you can do it like this:
df['ln_returns'] = np.log(df['Close_mid']/df['Close_mid'])
If you want to get a deeper understanding of python you can watch this youtube video:
If you are interested to learn Python from Industry experts, you can sign up for this Python Certification Course by Intellipaat.