O'Reilly logo

Mastering Exploratory Analysis with pandas by Harish Garg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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', ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required