Iván

Pandas

数据分析v1.0.1
作者:Iván更新于 2026-05-11共 2 个版本 · 最新版本发布于 2026-02-25pandas@clawhub_ivangdavila/pandas
数据清洗

据 AlphaMoat 统计,截至 2026-09,Pandas 累计下载 2,959 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 3,756 位,在「数据分析」分类(399 个)中排名第 283 位。

累计安装
230
累计下载
2,959
星标
-
全站排名
#3,756
全站前 74% · 「数据分析」前 71%
平台累计安装累计下载星标评论
ClawHub ↗722,875--
SkillHub ↗2302,959-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

提供使用 pandas 筛选、分组、合并、透视和清理 DataFrame 的实用模式,建议采用向量化操作、显式处理缺失值,并在合并时进行校验。技能会在本地保存用户偏好,后续会话可能复用这些内容;不要在偏好文件中存储敏感信息,并在不再需要时检查或清除。

资料发布于 2026-10-27

可以用来做什么

  • 清理表格数据并处理缺失值
  • 合并、分组或透视 DataFrame 以进行分析

什么时候用

  • 需要使用 Python 整理和分析表格数据时
  • 需要检查合并结果或管理本地偏好记录时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

用 pandas 清理这份表格,先检查缺失值并验证合并结果。

月度数据趋势

累计下载2,959
9232,0173,1102026-03 · 累计下载 1,0742026-05 · 累计下载 1,7942026-06 · 累计下载 2,0512026-07 · 累计下载 2,3982026-08 · 累计下载 2,7072026-09 · 累计下载 2,95926-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-06 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-092,959—-
2026-082,707+12.9%-
2026-072,398+16.9%-
2026-062,051+14.3%-
2026-051,794—-
2026-031,074—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

3.8 KB · ClawHub v1.0.1
---
name: Pandas
slug: pandas
version: 1.0.1
homepage: https://clawic.com/skills/pandas
description: Analyze, transform, and clean DataFrames with efficient patterns for filtering, grouping, merging, and pivoting.
metadata: {"clawdbot":{"emoji":"🐼","requires":{"bins":["python3"]},"os":["linux","darwin","win32"]}}
---

## Setup
展开全部(共 132 行)

On first use, create `~/pandas/` and read `setup.md` for initialization. User preferences are stored in `~/pandas/memory.md` — users can view or edit this file anytime.

## When to Use

User needs to work with tabular data in Python. Agent handles DataFrame operations, data cleaning, aggregations, merges, pivots, and exports.

## Architecture

Memory lives in `~/pandas/`. See `memory-template.md` for structure.

```
~/pandas/
├── memory.md     # User preferences and common patterns
└── snippets/     # Saved code patterns (optional)
```

## Quick Reference

| Topic | File |
|-------|------|
| Setup process | `setup.md` |
| Memory template | `memory-template.md` |

## Core Rules

### 1. Use Vectorized Operations
- NEVER iterate with `for` loops over DataFrame rows
- Use `.apply()` only when vectorized alternatives don't exist
- Prefer `df['col'].str.method()` over `apply(lambda x: x.method())`

### 2. Chain Methods for Readability
```python
# Good: method chaining
result = (df
    .query('age > 30')
    .groupby('city')
    .agg({'salary': 'mean'})
    .reset_index())

# Bad: intermediate variables everywhere
filtered = df[df['age'] > 30]
grouped = filtered.groupby('city')
result = grouped.agg({'salary': 'mean'}).reset_index()
```

### 3. Handle Missing Data Explicitly
- Always check `df.isna().sum()` before analysis
- Choose strategy: `dropna()`, `fillna()`, or interpolation
- Document WHY missing values exist before removing them

### 4. Use Categorical for Repeated Strings
```python
# Memory savings for columns with few unique values
df['status'] = df['status'].astype('category')
df['country'] = df['country'].astype('category')
```

### 5. Merge with Validation
```python
# Always specify how and validate
result = pd.merge(
    df1, df2,
    on='id',
    how='left',
    validate='m:1'  # Many-to-one: catch unexpected duplicates
)
```

### 6. Prefer query() for Complex Filters
```python
# Readable
df.query('age > 30 and city == "NYC" and salary < 100000')

# Hard to read
df[(df['age'] > 30) & (df['city'] == 'NYC') & (df['salary'] < 100000)]
```

### 7. Set Index When Appropriate
```python
# Faster lookups, cleaner merges
df = df.set_index('user_id')
user_data = df.loc[12345]  # O(1) lookup
```

## Common Traps

- **SettingWithCopyWarning** → Use `.loc[]` for assignment: `df.loc[mask, 'col'] = value`
- **Slow loops** → Replace `iterrows()` with vectorized ops or `apply()`
- **Memory explosion** → Use `dtype` in `read_csv()`: `pd.read_csv(f, dtype={'id': 'int32'})`
- **Silent data loss** → Check shape before/after merge: `print(f"Before: {len(df1)}, After: {len(result)}")`
- **Index confusion** → Use `reset_index()` after `groupby()` to get clean DataFrame
- **Chained indexing** → `df['a']['b']` fails silently; use `df.loc[:, ['a', 'b']]`

## Security & Privacy

**Data storage:**
- User preferences stored in `~/pandas/memory.md`
- All DataFrame operations run locally
- No data is sent externally

**This skill does NOT:**
- Upload data to any service
- Access files outside `~/pandas/` and the working directory
- Modify source data files without explicit instruction

**User control:**
- View stored preferences: `cat ~/pandas/memory.md`
- Clear all data: `rm -rf ~/pandas/`

## Related Skills
Install with `clawhub install <slug>` if user confirms:
- `data-analysis` — general data analysis patterns
- `csv` — CSV file handling
- `sql` — database queries
- `excel-xlsx` — Excel file operations

## Feedback

- If useful: `clawhub star pandas`
- Stay updated: `clawhub sync`

「数据分析」分类下的热门技能

AdMapix数据分析

AdMapix 的取数层:把广告与应用相关的查询转成接口调用,只回原始 JSON。

↓ 36.6万★ 304fly0pants
Tavily Search数据分析

走 Tavily 检索公开网页,返回带链接与摘要的结构化结果。

↓ 12.2万★ 286Xiaoran Li
Data Analysis数据分析

把数据库、表格与导出的原始数据变成可决策结论的数据分析技能。

↓ 10.1万★ 244Iván
Stock Analysis数据分析

用 Yahoo Finance 数据做股票与加密货币分析、组合跟踪的技能。

↓ 7.5万★ 299udiedrichsen
Stock Watcher数据分析

管理本地自选股清单,并按代码汇总同花顺行情与近期表现的技能。

↓ 6.5万★ 122Robin797860
全国招标中标查询及分析【知了标讯】数据分析

全网招中标数据查询与分析助手。当用户涉及以下任何场景时,必须使用此SKILL:查询招标/中标公告、搜索标讯、查找临期/即将到期项目、商机预测、推荐潜在投标供应商、分析公司主营业务/历史中标、查询公司上下游合作客户与供应商、分析竞争对手/竞对企业、查询Top采购单位/Top中标单位/Top中标品牌、招中标数据统计分析(按月/季/年/省份/品牌等维度)、查询品牌型号历史中标单价/价格趋势、市场分析/行业分析/采购寻源/渠道拓展等采购与投标相关场景。即使用户没有提到「知了标讯」,只要涉及招投标、采购、中标、供应商、竞争对手等关键词,都应使用本SKILL。

↓ 5.6万★ 13user_98035bfb
Blogwatcher数据分析

用命令行监控博客与 RSS/Atom 源的更新。

↓ 5.4万★ 75Peter Steinberger
Model Usage数据分析

汇总 Codex 或 Claude 按模型计费的使用成本。

↓ 5.0万★ 114Peter Steinberger

Iván 的其他技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。