Introduction to Data Structures
Introduction to Data Structures
Series
DataFrame
Panel
These data structures are built on top of Numpy array, which means they are fast.
Building and handling two or more dimensional arrays is a tedious task, burden is placed on the
user to consider the orientation of the data set when writing functions. But using Pandas data
structures, the mental effort of the user is reduced.
For example, with tabular data (DataFrame) it is more semantically helpful to think of the index
(the rows) and the columns rather than axis 0 and axis 1.
Mutability
All Pandas data structures are value mutable (can be changed) and except Series all are size
mutable. Series is size immutable.
Note − DataFrame is widely used and one of the most important data structures. Panel is used
much less.
Series
https://www.tutorialspoint.com/python_pandas/python_pandas_introduction_to_data_structures.htm 1/3
1/7/23, 9:36 AM Introduction to Data Structures
Series is a one-dimensional array like structure with homogeneous data. For example, the
following series is a collection of integers 10, 23, 56, …
10 23 56 17 52 61 73 90 26 72
Key Points
Homogeneous data
Size Immutable
Values of Data Mutable
DataFrame
DataFrame is a two-dimensional array with heterogeneous data. For example,
The table represents the data of a sales team of an organization with their overall performance
rating. The data is represented in rows and columns. Each column represents an attribute and
each row represents a person.
Column Type
Name String
Age Integer
Gender String
Rating Float
Key Points
Heterogeneous data
Size Mutable
Data Mutable
https://www.tutorialspoint.com/python_pandas/python_pandas_introduction_to_data_structures.htm 2/3
1/7/23, 9:36 AM Introduction to Data Structures
Panel
Panel is a three-dimensional data structure with heterogeneous data. It is hard to represent the
panel in graphical representation. But a panel can be illustrated as a container of DataFrame.
Key Points
Heterogeneous data
Size Mutable
Data Mutable
https://www.tutorialspoint.com/python_pandas/python_pandas_introduction_to_data_structures.htm 3/3