ffn
ffn copied to clipboard
TypeError: 'Series' object is not callable
I am learning classes in Python using injection. I am trying to develop this class using FFN. This is my exercise.
`class PreparadorFFN:
def __init__(self, log_retornos_diarios):
self.cotiz_val = None
self.perf = None
def preparar_datos_ffn(self):
#self.data_val_ind = importador.cotizaciones[[nom_val, nom_ind]]["2017":"2021"].pct_change()
self.cotiz_val = importador.cotizaciones[[nom_val]]["2017":"2021"].pct_change()
self.cotiz_val[nom_val] = self.cotiz_val.cumsum() + 100
self.cotiz_val.iloc[0] = 100
self.cotiz_val.dropna(inplace=True)
np.seterr(all="ignore")
self.perf = self.cotiz_val[nom_val].calc_stats()
self.perf.display()
self.perf.display_monthly_returns()
self.perf.stats()
#print (f"\nCAGR {preparador_ffn.perf.stats['cagr']}")
retornos_diarios = variaciones.retornos_diarios log_retornos_diarios = variaciones.log_retornos_diarios
preparador_ffn = PreparadorFFN(log_retornos_diarios) preparador_ffn.preparar_datos_ffn() #preparador_ffn.imprimir() #preparar_datos_ffn.perf.stats #preparador_ffn.perf.stats`
It returns the following error
`---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
TypeError: 'Series' object is not callable`
How can I solve it? I will appreciate help.