Introduction to Pandas – Class 12 IP Revision Notes
- Pandas stand for (PANel DAta System)
- It was developed by Wes McKinney
- It is open-source python library that makes data science or data analysis easy and effective
- It provides the flexible and powerful functions and properties for 1D and 2D data structure
- It provides high-performance data analysis tools
- It is used in major fields like academic, commercial such as finance, economics, statistics and analytics etc.
Difference between NumPy and Pandas – Class 12 IP Revision Notes
Key Point | NumPy | Pandas |
---|---|---|
Data | Requires homogeneous data | Can have heterogeneous data |
Effectiveness | NumPy is very effective for same kind of collection | provides a simple interface for operations like select, access, plot, join and group by function |
Kind of data | It is a handy tool for numeric data | It is a handy tool for data processing in the tabular form of data |
Memory | Consumes less memory | Consumes more memory |
Indexing | Indexing is very quick | Indexing is slow compared to NumPy |
Features of Pandas – Class 12 IP Revision Notes
- Efficient to read different types of data like integer, float, double etc.
- In a data frame rows and columns can be added, deleted or modified anytime
- Support group by, aggregate functions, joining, merging
- Capable to pull data from MySQL database and CSV files and vice-versa
- Can extract data from large data set and combine multiple tabular data structures in a single unit
- Can find and fill missing data
- Reshaping and re-indexing can be done in various forms
- Can be used for future prediction from received data
- Provides functions for data visualization using matplotlib
Installing Pandas – Class 12 IP Revision Notes
- The installation can be done in pandas using pip command.
- Open cmd prompt to use pip commands
- Installing pandas – pip install pandas
- To uninstall pandas – pip uninstall pandas
Importing Pandas for a program
To import pandas follow this command
import pandas as pd
Data Structures in Pandas – Class 12 IP Revision Notes
- The way of storing, organizing, and maintaining data for appropriate applications is known as a data structure
- Can help in extracting information easily
- Pandas provide the following data structures:
- Series:
- It is a 1-dimensional data structure
- Stores homogeneous data
- It is data mutable and sizes immutable data structure
- DataFrame:
- It is 2 dimensional data structure
- Stores heterogeneous data
- It is data mutable as well as size mutable
- Panel
- It is a 3-dimensional data structure
- Series: