Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (19.9k points)

This line:

df['ln_returns'] = np.log(df['Close_mid']/df['Close_mid'](1))

Gives the following error:

'Series' object is not callable

1 Answer

0 votes
by (25.1k points)

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.

Related questions

Browse Categories

...