Time series and dates in pandas
Answer: pandas contains extensive capabilities and features for working with time series data for all domains. Using the NumPy datetime64 and timedelta64 dtypes, pandas has consolidated a large number of features from other Python libraries and created a tremendous amount of new functionality. (S1)
Time concepts
- Date times: a specific date and time with timezone support. (S1)
- Time spans: a span of time defined by a point in time and its associated frequency. (S1)
- Date offsets: a relative time duration that respects calendar arithmetic. (S1)
- The default resolution for date times and time deltas is microsecond, though second, millisecond, and nanosecond are also supported. (S1)
- For time series data, it's conventional to represent the time component in the index of a Series or DataFrame. (S1)
From strings to timestamps
- By applying the to_datetime function, pandas interprets the strings and converts these to datetime objects. (S2)
- pandas calls these datetime objects, similar to datetime.datetime from the standard library, pandas.Timestamp. (S2)
- Using pandas.Timestamp for datetimes enables us to calculate with date information and make them comparable. (S2)
- Subtracting timestamps gives a pandas.Timedelta object, similar to datetime.timedelta, which defines a time duration. (S2)
Claims
- id: C1 claim: pandas builds on datetime64 and timedelta64. source: S1 evidence: "Using the NumPy datetime64 and timedelta64 dtypes"
- id: C2 claim: Date offsets respect calendar arithmetic. source: S1 evidence: "A relative time duration that respects calendar arithmetic."
- id: C3 claim: to_datetime converts strings to datetimes. source: S2 evidence: "By applying the to_datetime function"
- id: C4 claim: Timestamps make dates comparable. source: S2 evidence: "information and make them comparable."
Sources
- [S1] Time series / date functionality — pandas 3.1.1 documentation. pandas docs. https://pandas.pydata.org/docs/user_guide/timeseries.html . License: BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE). Accessed 2026-11-04.
- [S2] How to handle time series data with ease — pandas 3.1.1 documentation. pandas docs. https://pandas.pydata.org/docs/getting_started/intro_tutorials/09_timeseries.html . License: BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE). Accessed 2026-11-04.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: pandas docs, Time series / date functionality — pandas 3.1.1 documentation, BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE); pandas docs, How to handle time series data with ease — pandas 3.1.1 documentation, BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE).
Cite this
iinventedlight. 2026. "Time series and dates in pandas." iinventedlight Library, iil:note:mnjqyc2w, version of 2026-11-04. https://iinventedlight.com/library/notes/pandas-time-series/. License: CC-BY-4.0.
@misc{iil_note_mnjqyc2w,
author = {{iinventedlight}},
title = {{Time series and dates in pandas}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-04},
url = {https://iinventedlight.com/library/notes/pandas-time-series/},
note = {Permanent ID iil:note:mnjqyc2w. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/pandas-time-series.md.