Pandas Tutorial for Data Science

📘 Data Science 👁 90 views 📅 Nov 14, 2025
⏱ Estimated reading time: 1 min

Introduction

Pandas is the most important library for data manipulation and analysis. It provides two key data structures: Series and DataFrame.

1. Creating a Series


import pandas as pd

s = pd.Series([10, 20, 30])
print(s)
  

2. Creating a DataFrame


df = pd.DataFrame({
  "Name": ["John", "Mary"],
  "Age": [28, 34]
})
print(df)
  

3. Reading Data


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

4. Selecting Columns


df["Age"]
df[["Name", "Age"]]
  

5. Filtering Data


df[df["Age"] > 30]
  

6. Handling Missing Values


df.isnull().sum()
df.fillna(0)
df.dropna()
  

7. Sorting Data


df.sort_values("Age", ascending=False)
  

8. Grouping Data


df.groupby("Department")["Salary"].mean()
  

9. Merging DataFrames


merged = pd.merge(df1, df2, on="id")
  

Conclusion

Pandas is the heart of data analysis, making data cleaning and transformation fast and efficient.


🔒 Some advanced sections are available for Registered Members
Register Now

Share this Post


← Back to Tutorials

Popular Competitive Exam Quizzes

🤖 AI Quizer Assistant

📝 Quiz
📚 Categories
🏆 Leaderboard
📊 My Score
❓ Help
👋 Hi! I'm your AI quiz assistant for Quizer.in!

I can help you with:
• 📝 Finding quizzes
• 🏆 Checking leaderboard
• 📊 Your performance stats

Type 'help' to get started! 🚀
AI is thinking...