Lesson 16 of 60 · python
Introduction to Pandas
Duration: 15 minutes
Introduction to Pandas
Pandas is the go‑to library for tabular data manipulation in Python. It provides two primary data structures: Series (1‑D) and DataFrame (2‑D).
Installing Pandas
pip install pandas
Creating a Series
import pandas as pd
s = pd.Series([10, 20, 30], index=['a', 'b', 'c'])
print(s)
Creating a DataFrame
data = {
"name": ["Alice", "Bob", "Charlie"],
"age": [25, 30, 35],
"salary": [70000, 80000, 90000]
}
df = pd.DataFrame(data)
print(df)