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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.