Python error "'Series' object is not callable "

1.2K    Asked by ColemanGarvin in Python , Asked on Apr 13, 2021

This line:

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

Gives the following error:

'Series' object is not callable

Answered by Coleman Garvin

If you are facing typeerror: 'series' object is not callable error then the problem maybe that 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'])


Your Answer

Interviews

Parent Categories