What are the different types of data structures in pandas

 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-

  1. Series
  2. DataFrame
  3. Panel

 1. Series

        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. 

 2. DataFrame

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.NameAccount nosalary

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


 3. Panel

            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 StructureDimensionData TypeDataSize
SeriesOne-dimensional ArrayHomogeneousMutableimmutable
Data FrameTwo-dimensional ArrayHeterogeneousMutableMutable
PanelThree-dimensional ArrayHeterogeneousMutableMutable

Leave a Reply

Your email address will not be published.

Follow by Email