Introduction To Pandas
pandas is a fast, powerful, flexible and easy-to-use open source data analysis and manipulation tool, built on top of the Python programming language.

What is Pandas ?
Installing Pandas
Read CSV and Text files Through Pandas
Result:

Read Top few rows or Bottom few:
head() Function :


Load Data Without Header

To Read Data Separated by any delimiter :
To work on Specific Column:

To work on more than one columns:

To Read Headers:

To get the Data Types Of Columns:

Statistical Describing Data
#
Total
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Slicing Pandas Data frame using DataFrame.iloc[]
Syntax For Slicing:
Slicing For Rows :
#
Name
Type 1
Type 2
Total
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
Slicing For Columns :
#
Name
Type 1
Type 2
Performing Iteration In DataFrame :
Iteration Over Rows Using iterrows() Function :

Iteration Over Columns Using iteritems() Function :
Filtering Data in Pandas DataFrame Using loc[] :
Sorting of Data in DataFrame Using sort.values() Function :
Sort in Ascending Order
#
Name
Type 1
Type 2
Total
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
Sort in Descending Order
#
Name
Type 1
Type 2
Total
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
Sorting of Multiple Columns in different order using sort.values():
#
Name
Type 1
Type 2
Total
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
How to Create New Column in DataFrame Using Old Ones:
#
Name
Type 1
Type 2
Total
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
T
total_sum
total_s
How to change Columns Positions :
#
Name
Type 1
Type 2
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
Exporting Data And Creating a New File :
To Export File in CSV:

#
Player
Match1
Match2
Match3
Parameters :
#
Player
Match1
Match2
Match3
To Export File in Excel:
#
Player
Match1
Match2
Match3
Deleting a Column by using drop() :
Parameters :
#
Name
Type 1
Type 2
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
Reset all the indexes :
#
Name
Type 1
Type 2
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
Filtering Data with Multiple Conditions using loc[]:
#
Name
Type 1
Type 2
Total
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
To Replace Values in Column Based on Condition in Pandas :
#
Name
Type 1
Type 2
Total
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
Aggregate Statistics (Groupby) perform grouping operations:
#
Name
Type 1
Type 2
Total
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
count
Initialize All Values of A Column :
#
Name
Type 1
Type 2
Total
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
count
Working With Large Amount of Data :
#
Name
Type 1
Type 2
Total
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary
Generate a Column With Random Numbers :
#
Name
Type 1
Type 2
Total
HP
Attack
Defense
Sp. Atk
Sp. Def
Speed
Generation
Legendary

Last updated