How To Replace Array Elements In Python