Enable automatic visualization of NumPy arrays in the IPython Notebook.

def enable_notebook():
    """Enable automatic visualization of NumPy arrays in the IPython Notebook."""
    try:
        from IPython.core.getipython import get_ipython
    except ImportError:
        raise ImportError('This feature requires IPython 1.0+')
    ip = get_ipython()
    f = ip.display_formatter.formatters['text/html']
    f.for_type(np.ndarray, _array_to_html)