When I do this ...
import numpy as np
... i can use it but ...
import pprint as pp
... can not, as I need to do this ...
from pprint import pprint as pp
and there is also __import__(str(module))
and possibly more hidden in the documentation.
I have had a few reads around, 'import module' or 'from module import' for instance, but the answers are more targeted towards making a choice on which to use. Also, python-how-to-import-other-python-files just gives more insight on pros and cons.
Could someone shed some light on why there is a difference; what goes on behind the scenes when using the different types of import and how they all work?