Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying IPython Notebook Essentials
  • Table Of Contents Toc
IPython Notebook Essentials

IPython Notebook Essentials

By : Martins
3.7 (3)
close
close
IPython Notebook Essentials

IPython Notebook Essentials

3.7 (3)
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)
close
close

Sequence types

Python sequence types are used to represent ordered collections of objects. They are classified into mutable and immutable sequence types. Here, we will only discuss lists (mutable) and tuples and strings (both immutable). Other sequence types are mentioned at the end of this section.

Lists

The following example shows how to construct a list in Python and assign it to a variable:

numbers = [0, 1.2, 234259399992, 4+3j]

Individual entries in the list are accessed with index notation as follows:

numbers[2]

Notice that indexing always starts with 0. Negative indices are allowed and they represent positions starting at the end of the list. For example, numbers[-1] is the last entry, numbers[-2] is the next-to-last entry, and so forth.

Since lists are a mutable sequence type, we are allowed to modify the entries in-place:

numbers[0] = -3
numbers[2] += numbers[0]
print numbers

Another important way to refer to elements in a Python sequence type is slices, which allow the extraction of...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
IPython Notebook Essentials
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon