When I try to use pyplot
from matplotlib
:
import matplotlib
print matplotlib.pyplot # just checking
It gives me AttributeError: 'module' object has no attribute 'pyplot'
It can be solved with:
import matplotlib.pyplot
But what I am really confused with is,
import numpy
print numpy.random
gives me <module 'numpy.random' from '/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/numpy/random/__init__.pyc'>
What is the difference between two cases? pyplot
cannot be called in the first example, but random
was in the second. I think it's related with some kind of packages and modules. But I'm not such a professional to the python, thus asking for an answer.