Data Structures

tags: #python/pandas

There are two primary data structures of pandas:

Dimension Name Description Constructor
1 Series A one-dimensional labeled array capable of holding any data type. Essentially a single column (array) of data with an associated index[1]. pd.Series()
2 DataFrame A two-dimensional labeled data structure with columns that can be of different data types. Essentially, a collection of series. pd.DataFrame()
Pasted image 20240114210400.png
Distinguishing the Two

We can think of a DataFrame as a spreadsheet where each column is a series.

Axes In a DataFrame

DataFrame Objects is a two-dimensional Data Structure with 2 Axes

DataFrame object has two axes: “axis 0” and “axis 1”. “axis 0” represents rows and “axis 1” represents columns

Pasted image 20250330212521.png500


  1. Every element in a Series is associated with an index. ↩︎

Powered by Forestry.md