Typescript Change Index In Array Python Question