from matplotlib import pyplot as plt
Is matplotlib (the module) or pyplot (the object) being renamed as plt? Also, what’s a namespace?
from matplotlib import pyplot as plt
Is matplotlib (the module) or pyplot (the object) being renamed as plt? Also, what’s a namespace?
It is pyplot
that is given the alias, plt
.
Also what is a namespace?
A namespace describes where variables and modules reside. Each scope is its own namespace. I could be wrong but I believe even modules are their own namespace.
Oh that makes sense and by scope are you referring to global variables or variables inside a function, etc.?
Yes. Each block has its own scope.
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.