I use Emacs' org-mode for data science and for math courses. With Babel you can evaluate code and see the results in-line, with syntax highlighting. I don't use code completion myself but I'm confident it's available. With LaTeX preview, you can see mathematical formulae pre-rendered, again in-page.
You can then export from org-mode to LaTex, defining all the relevant settings at the top of the page.
You can then export from org-mode to LaTex, defining all the relevant settings at the top of the page.