pandas Series and DataFrame
Answer: The two primary data structures of pandas, Series (1-dimensional) and DataFrame (2-dimensional), handle the vast majority of typical use cases. pandas is built on top of NumPy and is intended to integrate well within a scientific computing environment with many other 3rd party libraries. (S1)
How they relate
- DataFrame is a container for Series, and Series is a container for scalars. (S1)
- The length of a Series cannot be changed, but, for example, columns can be inserted into a DataFrame. (S1)
Labels and alignment
- The fundamental behavior about data types, indexing, axis labeling, and alignment apply across all of the objects. (S2)
- The axis labels are collectively referred to as the index. (S2)
- The link between labels and data will not be broken unless done so explicitly by you. (S2)
Series and NumPy
- Series acts very similarly to a numpy.ndarray and is a valid argument to most NumPy functions. (S2)
- Like a NumPy array, a pandas Series has a single dtype. (S2)
- If you need the actual array backing a Series, use Series.array. (S2)
Claims
- id: C1 claim: Series is 1-dimensional and DataFrame 2-dimensional. source: S1 evidence: "and DataFrame (2-dimensional), handle the vast majority of typical use"
- id: C2 claim: DataFrame is a container for Series. source: S1 evidence: "for Series, and Series is a container for scalars."
- id: C3 claim: The axis labels are called the index. source: S2 evidence: "labels are collectively referred to as the index."
- id: C4 claim: A Series has a single dtype. source: S2 evidence: "Like a NumPy array, a pandas Series has a single dtype."
Sources
- [S1] Package overview — pandas 3.1.1 documentation. pandas docs. https://pandas.pydata.org/docs/getting_started/overview.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] Intro to data structures — pandas 3.1.1 documentation. pandas docs. https://pandas.pydata.org/docs/user_guide/dsintro.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, Package overview — 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, Intro to data structures — 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. "pandas Series and DataFrame." iinventedlight Library, iil:note:rv9ymqq5, version of 2026-11-04. https://iinventedlight.com/library/notes/pandas-data-structures/. License: CC-BY-4.0.
@misc{iil_note_rv9ymqq5,
author = {{iinventedlight}},
title = {{pandas Series and DataFrame}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-04},
url = {https://iinventedlight.com/library/notes/pandas-data-structures/},
note = {Permanent ID iil:note:rv9ymqq5. 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-data-structures.md.