Container Types

Container types are used to group objects together. The main difference between the different container types is the way individual elements are accessed and how operations are defined. In this chapter, we discuss container types such as lists, tuples, dictionaries, and sets and related concepts such as indexing techniques. More specialized containers such as pandas DataFrames will be presented in Chapter 4: Linear Algebra – Arrays, Chapter 5: Advanced Array Concepts, and Chapter 10: Series and DataFrames.

In particular, we will cover the following topics:

  • Lists
  • Arrays
  • Tuples
  • Dictionaries
  • Sets

3.1 Lists

In this section, we introduce lists  the most frequently used container datatype in Python. With lists, we can refer to ...

Get Scientific Computing with Python - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.