Dispongo del siguiente dataframe:
data.info()
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 658 entries, 2016-01-04 to 2019-01-31
Data columns (total 4 columns):
Equity 658 non-null float64
Equity 658 non-null float64
Equity 658 non-null float64
Equity 658 non-null float64
dtypes: float64(4)
memory usage: 25.7 KB
Intento renombrar las columnas.
old_names = ['Equity', 'Equity', 'Equity', 'Equity' ]
new_names = ['Equity1','Equity2', 'Equity3','Equity4' ]
data.rename(columns=dict(zip(old_names, new_names)), inplace=True)
Me devuelve el error.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-123-9f8bfefe3429> in <module>
1 old_names = ['Equity', 'Equity', 'Equity', 'Equity' ]
2 new_names = ['Equity1','Equity2', 'Equity3','Equity4' ]
----> 3 data.rename(columns=dict(zip(old_names, new_names)), inplace=True)
TypeError: 'dict' object is not callable
¿Cual puede ser la causa?. Agradeceré vuestra ayuda.