There are three types of Data Structure in Pandas. Prior to Pandas, Python was only used for data wrangling and preparation. Using Pandas we can perform more steps in the processing and analysis of data- Load, Prepare, Manipulate, Model, and Analyze using its powerful data structures.
Pandas have three types of data structures-
A Series is a one dimensional array like structure with homogeneous data. The values of the series are mutable means we can change any value in series, but the size of the series is immutable so we can not change the size of the series. A series can hold any type of data like integer, decimal, string, python objects, etc. For Example
in the above example, Series 1 has integer numbers whereas Series 2 has decimal numbers so it is called homogeneous. we can not put a decimal number in an integer number series or any integer number in any decimal number series.
DataFrame is a two-dimensional array with heterogeneous data. A DataFrame size is mutable and data is also mutable so we can change the data and size of DataFrame at any time. For example
|S. no.||Name||Account no||salary|
The table represents the data of a company employee. The data is represented in rows and columns. Each column represents an attribute and each row represents a person
The panel is a three-dimensional data structure with heterogeneous data. It is very hard to represent the Panel in a graphical representation. But a Panel can be illustrated as a container of a DataFrame. In Panel Data and size are mutable.
|Data Structure||Dimension||Data Type||Data||Size|
|Data Frame||Two-dimensional Array||Heterogeneous||Mutable||Mutable|