PANDAS Tutorial



Introduction to pandas


πŸ“Š 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.

πŸ”₯ Key Use Cases: Data cleaning, analysis, transformation, aggregation, visualization (basic), and preparation for machine learning.

πŸ“¦ How to Install Pandas

pip install pandas

Or install it along with Jupyter and NumPy:

pip install jupyter pandas numpy

πŸ“‚ Importing Pandas

Use this command in your Python script or notebook:

import pandas as pd

Why as pd? It allows you to use shorter aliases like pd.DataFrame().

πŸ“„ What is a DataFrame?

A DataFrame is a 2D labeled data structure (like a table with rows and columns). It’s the most used object in pandas.

βœ… Creating a DataFrame

import pandas as pd
data = {
"Name": ["Alice", "Bob", "Charlie"],
"Age": [25, 30, 35],
"City": ["Delhi", "Mumbai", "Bangalore"]
}

df = pd.DataFrame(data)
print(df)

πŸ’‘ Output:

 Name Age City 0 Alice 25 Delhi 1 Bob 30 Mumbai 2 Charlie 35 Bangalore 

πŸ§ͺ Common Pandas Operations

  • df.head() – Shows top 5 rows
  • df.tail() – Shows bottom 5 rows
  • df.info() – Displays structure info
  • df.describe() – Shows statistical summary
  • df['ColumnName'] – Access a specific column

πŸ“₯ Reading External Files

df = pd.read_csv("data.csv")

You can also read Excel, JSON, SQL, etc.

πŸ“Œ Note: Pandas is built on top of NumPy. So basic NumPy knowledge is a plus.

🎯 Conclusion

Pandas is your go-to toolkit for data wrangling in Python. It’s intuitive, powerful, and a must-have skill in data science, machine learning, and analytics.

βœ… Next: Learn about DataFrame indexing and filtering to extract and work with specific data.

🌟 Enjoyed Learning with Us?

Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!

Leave a Google Review