0Pricing
Learn AI with Python · Lesson

Time Series in Pandas

DatetimeIndex, resample(), rolling(), shift(), date range generation and resampling.

Time in pandas

pandas has first-class datetime support. Converting strings to timestamps and indexing by time unlocks resampling, rolling windows, and lag features.

Parsing with to_datetime

pd.to_datetime converts strings or numbers into proper Timestamp objects, inferring most common formats automatically.

import pandas as pd
d = pd.to_datetime(["2026-01-01", "2026-01-05", "2026-02-10"])
print(d)
print(d.dtype)   # datetime64[ns]

All lessons in this course

  1. GroupBy and Aggregation
  2. Pivot Tables and Cross-Tabulation
  3. Advanced Merging and Joining
  4. Time Series in Pandas
← Back to Learn AI with Python