First import NumPy and Matplotlib:
%pylab inline
Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.kernel.zmq.pylab.backend_inline]. For more information, type 'help(pylab)'.
import numpy as np
Now we show some very basic examples of how they can be used.
a = np.random.uniform(size=(100,100))
a.shape
(100, 100)
evs = np.linalg.eigvals(a)
evs.shape
(100,)
Here is a cell that has both text and PNG output:
hist(evs.real)
(array([95, 4, 0, 0, 0, 0, 0, 0, 0, 1]), array([ -2.93566063, 2.35937011, 7.65440086, 12.9494316 , 18.24446235, 23.53949309, 28.83452384, 34.12955458, 39.42458533, 44.71961607, 50.01464682]), <a list of 10 Patch objects>)