My problem is that I have time series, and I need to create a new column that gives me the natural logarithm of today's price divided by yesterday's price, and that these values are in a new column
#Accion1['Rentabilidad1'] = Accion1.apply(lambda row: np.log(Promedio), axis=1)
Accion1['Rentabilidad'] = np.log(Accion1['Promedio'])
Accion1
I was thinking of creating new variables and splitting iloc[0]/iloc[1] but it doesn't work either, please help