pandas

3.0.1 · active · verified Wed Mar 25

The standard Python DataFrame library for data analysis. Current version is 3.0.1 (Feb 2026). pandas 3.0 is a major release with two ecosystem-wide breaking changes: Copy-on-Write (CoW) is now the only mode, and string columns now default to str dtype instead of object. Requires Python >=3.11.

Warnings

Install

Imports

Quickstart

pandas 3.0 patterns. Use loc for in-place modification. Strings are str dtype not object.

import pandas as pd
import numpy as np

# Create DataFrame
df = pd.DataFrame({
    'name': ['Alice', 'Bob', 'Charlie'],
    'score': [85, 92, 78],
    'dept': ['eng', 'eng', 'mkt']
})

# Correct modification in pandas 3.0 (CoW)
df.loc[df['score'] > 80, 'grade'] = 'pass'

# Or use assign() for derived columns (returns new DataFrame)
df = df.assign(grade=lambda x: np.where(x['score'] > 80, 'pass', 'fail'))

# Check dtypes — strings are now 'str', not 'object'
print(df.dtypes)
# name     str
# score    int64
# dept     str

view raw JSON →