# Wrangling

> Data wrangling fundamentals

- Skill: `ffsshhttiikk/wrangling` (Agent Skill)
- Install (CLI): `npx skillmds@latest add ffsshhttiikk/wrangling`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ffsshhttiikk/wrangling/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: ffsshhttiikk (https://skillmd.com/u/ffsshhttiikk)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/ffsshhttiikk/wrangling

---


## What I do

- Transform and clean raw data
- Reshape data structures
- Handle data quality issues
- Parse and extract from unstructured formats
- Merge and join datasets
- Create derived features

## When to use me

Use me when:
- Raw data needs preparation
- Data from multiple sources needs combining
- Complex transformations required
- Preparing data for analysis or ML

## Key Concepts

### Common Transformations
```python
import pandas as pd

# Pivot/Unpivot
pivot_df = df.pivot(index="date", columns="product", values="sales")
melted = pd.melt(df, id_vars=["id"], value_vars=["q1","q2","q3","q4"])

# String operations
df["email_domain"] = df["email"].str.split("@").str[1]
df["name_clean"] = df["name"].str.strip().str.title()

# Conditional logic
df["segment"] = np.where(df["income"] > 100000, "Premium",
                np.where(df["income"] > 50000, "Standard", "Basic"))

# Apply custom functions
def categorize(age):
    if age < 18: return "minor"
    elif age < 65: return "adult"
    return "senior"
    
df["age_category"] = df["age"].apply(categorize)

# Rolling calculations
df["rolling_avg"] = df["sales"].rolling(window=7).mean()
df["pct_change"] = df["sales"].pct_change()
```

