In emacs, I use ipython in the inferior python mode with config:
(setq python-shell-interpreter "ipython"
python-shell-interpreter-args "--simple-prompt -i")
When I edit my .py file, without any input to inferior python, the input number jumps occasionally.
I suspect that I send some unintentional inputs to the inferior python. But, I don't know how. It happens quite randomly.