Most probably you are using m
instead of m-1
for index. Check this thread.
Debugging IPython or Jupyter Notebooks is not very elegant.
Here is my older post for debugging for beginners.
In short, you can call breakpoint()
whenever you want to invoke the pdb
debugger. Some versions do not support that, in that case you can use a more “hacky” way:
assert False, "breakpoint"
Cheers