Reader small image

You're reading from  IPython Notebook Essentials

Product typeBook
Published inNov 2014
Publisher
ISBN-139781783988341
Edition1st Edition
Tools
Right arrow
Author (1)
Luiz Felipe Martins
Luiz Felipe Martins
author image
Luiz Felipe Martins

Luiz Felipe Martins holds a PhD in applied mathematics from Brown University and has worked as a researcher and educator for more than 20 years. His research is mainly in the field of applied probability. He has been involved in developing code for the open source homework system, WeBWorK, where he wrote a library for the visualization of systems of differential equations. He was supported by an NSF grant for this project. Currently, he is an Associate Professor in the Department of Mathematics at Cleveland State University, Cleveland, Ohio, where he has developed several courses in applied mathematics and scientific computing. His current duties include coordinating all first-year calculus sessions.
Read more about Luiz Felipe Martins

Right arrow

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:

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

Image('http://www.imagesource.com/Doc/IS0/Media/TR5/7/7/f/4/IS09A9H4K.jpg...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
IPython Notebook Essentials
Published in: Nov 2014Publisher: ISBN-13: 9781783988341

Author (1)

author image
Luiz Felipe Martins

Luiz Felipe Martins holds a PhD in applied mathematics from Brown University and has worked as a researcher and educator for more than 20 years. His research is mainly in the field of applied probability. He has been involved in developing code for the open source homework system, WeBWorK, where he wrote a library for the visualization of systems of differential equations. He was supported by an NSF grant for this project. Currently, he is an Associate Professor in the Department of Mathematics at Cleveland State University, Cleveland, Ohio, where he has developed several courses in applied mathematics and scientific computing. His current duties include coordinating all first-year calculus sessions.
Read more about Luiz Felipe Martins