Working with date and time series data

In this section, we will take a closer look at how to work with date and time series data in pandas. We'll also see how to:

  • Convert strings to datetime types for advanced datetime series operations
  • Select and filter datetime series data
  • Explore properties of series data

We will begin by importing the pandas module in to our Jupyter notebook:

import pandas as pd

For this example, let's create our own DataFrame dataset. We can do this by using the following code:

dataset = pd.DataFrame({'DOB': ['1976-06-01', '1980-09-23', '1984-03-30', '1991-12-31', '1994-10-2', '1973-11-11'],                         'Sex': ['F', 'M', 'F', 'M', 'M', 'F'],                         'State': ['CA', 'NY', 'OH', 'OR', 'TX', 'CA'],  'Name': ['Jane', 'John', 'Cathy', 'Jo', ...

Get Mastering Exploratory Analysis with pandas now with O’Reilly online learning.

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