Skip to main content
Course/Module 2/Topic 2 of 4Beginner

Pandas Data Manipulation

Learn powerful data manipulation and analysis with Pandas

60 minBy Priygop TeamLast updated: Feb 2026

What is Pandas?

Pandas is a powerful data manipulation and analysis library for Python. It provides data structures for efficiently storing and manipulating large datasets, with tools for reading and writing data in various formats.

Key Data Structures

  • Series: 1-dimensional labeled array
  • DataFrame: 2-dimensional labeled data structure
  • Panel: 3-dimensional labeled data structure

Creating DataFrames

Example
import pandas as pd
import numpy as np

# Create DataFrame from dictionary
data = {
    'Name': ['Alice', 'Bob', 'Charlie', 'Diana'],
    'Age': [25, 30, 35, 28],
    'City': ['NYC', 'LA', 'Chicago', 'Boston'],
    'Salary': [50000, 60000, 70000, 55000]
}
df = pd.DataFrame(data)

# Create DataFrame from list of lists
data_list = [
    ['Alice', 25, 'NYC', 50000],
    ['Bob', 30, 'LA', 60000],
    ['Charlie', 35, 'Chicago', 70000]
]
df2 = pd.DataFrame(data_list, columns=['Name', 'Age', 'City', 'Salary'])

print(df.head())

Data Selection and Filtering

Example
# Select columns
print(df['Name'])
print(df[['Name', 'Age']])

# Filter data
young_people = df[df['Age'] < 30]
high_salary = df[df['Salary'] > 60000]

# Multiple conditions
filtered = df[(df['Age'] > 25) & (df['Salary'] > 55000)]

# Sort data
sorted_df = df.sort_values('Age', ascending=False)

Additional Resources

Recommended Reading

  • Python for Data Analysis by Wes McKinney
  • Python Data Science Handbook by Jake VanderPlas
  • NumPy and Pandas Official Documentation

Online Resources

  • NumPy Tutorial
  • Pandas Getting Started Guide
  • Matplotlib Tutorial
Chat on WhatsApp
Priygop - Leading Professional Development Platform | Expert Courses & Interview Prep