Reputation: 3937
I am trying to change the index of a Series. The indices are Date
s. cashflow_series
is the Series, and I am just trying to add a certain number of months to this date by using replace(month = cashflow_series.index[k].month + dict_no_months_between_payments[count])
on the index and use this to replace the previous index date. However, I get the error SyntaxError: Invalid Syntax
.
index_here = cashflow_series.index[k]
cashflow_series.index[k] = cashflow_series.index[k].reindex(index=index_here.(replace(month = cashflow_series.index[k].month + dict_no_months_between_payments[count])))
Upvotes: 0
Views: 132
Reputation: 49330
You have one set of parentheses too many:
index_here.(replace
^
Remove that one and its closing match.
Upvotes: 1