Book Image

IPython Notebook Essentials

By : Martins
Book Image

IPython Notebook Essentials

By: Martins

Overview of this book

If you are a professional, student, or educator who wants to learn to use IPython Notebook as a tool for technical and scientific computing, visualization, and data analysis, this is the book for you. This book will prove valuable for anyone that needs to do computations in an agile environment.
Table of Contents (10 chapters)

The rich display system

In an exciting development, recent versions of IPython include the capability to display images, video, sound, and other media directly in the notebook. The classes that support the display system are in the IPython.display module. In this section, we will discuss some of the supported formats.

Images and YouTube videos

Images can be loaded either from the local filesystem or from the web. To display the image contained in the character.png file, for example, run the following command in a cell:

from IPython.display import Image
Image('character.png')

It is also possible to store the image in a variable to be displayed at a later time:

img = Image('character.png')

The character.png file can be downloaded from the web page of this book.

To display the image, we can use either img or display(img). The following image is displayed:

Images and YouTube videos

To load an image from the Web, simply give its URL as an argument:

Image('http://www.imagesource.com/Doc/IS0/Media/TR5...