I'm working with a little dataframe it has a column with dates. I'm trying to rename the column but I get de following error: TypeError: 'list' object is not callable
, anyone knows what am I doing wrong?
The code is the following:
import pandas as pd
from datetime import datetime, timedelta
inicio = datetime(2017,10,1)
fin = datetime(2017,10,5)
lista_fechas = [(inicio + timedelta(days=d)).strftime("%Y-%m-%d")
for d in range((fin - inicio).days + 1)]
print(lista_fechas)
df = pd.DataFrame(data=lista_fechas)
df1 = df.rename(columns=['0', 'Fecha'])