iterative corr: translation to python