Introducing the pandas Series and DataFrame
Let's jump into using some pandas with a brief introduction to pandas two main data structures, the Series
and the DataFrame
. We will examine the following:
- Importing pandas into your application
- Creating and manipulating a pandas
Series
- Creating and manipulating a pandas
DataFrame
- Loading data from a file into a
DataFrame
Importing pandas
Every notebook we will use starts by importing pandas and several other useful Python libraries first. It will also set up several options to control how pandas renders output in a Jupyter Notebook. This code consists of the following:

The first statement imports NumPy and refers to items in the library as np.
. We won't go into much detail on NumPy in this book, but it is occasionally needed.
The second import makes pandas available to the notebook. We will refer to items in the library with the pd.
prefix. The from pandas import Series, DataFrame
statement explicitly imports the Series
and DataFrame
objects into the...