2 The Series object

This chapter covers

  • Instantiating Series objects from lists, dictionaries, tuples, and more
  • Setting a custom index on a Series
  • Accessing attributes and invoking methods on a Series
  • Performing mathematical operations on one or more Series
  • Passing the Series to Python’s built-in functions

One of pandas’ core data structures, the Series is a one-dimensional labeled array for homogeneous data. An array is an ordered collection of values comparable to a Python list. The term homogeneous means that the values are of the same data type (all integers or all Booleans, for example).

Pandas assigns each Series value a label—an identifier we can use to locate the value. The library also assigns each Series value an order—a position ...

Get Pandas in Action 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.