Rails Convert Array To String Python Replace Characters