PEP 08 states:
Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants.<
I would like to mention a usecase of mine, very similar to those mentioned by @John Millikin and @V.K. :
I do data analysis with Jupyter Notebook, and I use the same IPython notebook as a template for all analyses. In some occasions, I need to import Tensorflow to do some quick model runs, but sometimes I work in places where tensorflow isn't set up / is slow to import. In those cases, I encapsulate my Tensorflow-dependent operations in a helper function, import tensorflow inside that function, and bind it to a button.
This way, I could do "restart-and-run-all" without having to wait for the import, or having to resume the rest of the cells when it fails.