Python Str Replace Based On Index