I am converting some code from MATLAB to Python, and I have encountered an issue I can\'t resolve. When iterating over the For loop in the section of code, my for loop is sp