user131983
user131983

Reputation: 3937

Syntax Error when changing the index of a Series

I am trying to change the index of a Series. The indices are Dates. 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

Answers (1)

TigerhawkT3
TigerhawkT3

Reputation: 49330

You have one set of parentheses too many:

index_here.(replace
           ^

Remove that one and its closing match.

Upvotes: 1

Related Questions