instances/xiaodazi/skills/excel-analyzer/SKILL.md
Analyze and process Excel/CSV files using pandas and openpyxl. Supports data summary, filtering, pivot tables, and chart generation.
npx skillsauth add malue-ai/dazee-small excel-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
帮助用户分析和处理 Excel/CSV 文件。
首次使用时自动安装:
pip install pandas openpyxl
通过 Python 脚本使用 pandas 处理 Excel/CSV 文件。
import pandas as pd
# 读取 Excel
df = pd.read_excel("/path/to/file.xlsx", sheet_name=0)
# 读取 CSV
df = pd.read_csv("/path/to/file.csv")
# 查看基本信息
print(f"行数: {len(df)}, 列数: {len(df.columns)}")
print(f"列名: {list(df.columns)}")
print(df.head())
# 基本统计
print(df.describe())
# 按列汇总
print(df.groupby("类别").agg({"金额": ["sum", "mean", "count"]}))
# 条件筛选
filtered = df[df["金额"] > 1000]
# 多条件
filtered = df[(df["部门"] == "销售") & (df["金额"] > 500)]
# 导出到新 Excel
result.to_excel("/path/to/output.xlsx", index=False)
# 导出到 CSV
result.to_csv("/path/to/output.csv", index=False, encoding="utf-8-sig")
分析前和分析后都要做数据校验,确保结果可信:
# 1. 行数校验:打印清洗前后行数,确认只去了空行/噪音行
print(f"清洗前: {len(df_raw)} 行 → 清洗后: {len(df_clean)} 行 (去除 {len(df_raw)-len(df_clean)} 行)")
# 2. 分类列去重:检查分类列(如地区、产品)是否有近似重复值
for col in categorical_columns:
unique_vals = df_clean[col].unique()
print(f"列 '{col}' 唯一值: {unique_vals}")
# 检查近似重复(如 "华东" vs "华东地区")
# 如有近似重复,合并为统一值
# 3. 聚合一致性校验:各分组 sum 必须等于总 sum
total = df_clean["金额"].sum()
group_total = df_clean.groupby("地区")["金额"].sum().sum()
assert abs(total - group_total) < 0.01, f"聚合不一致: 总额 {total} ≠ 分组合计 {group_total}"
development
Local web search (Tavily/Exa, requires API Key). For quick searches. If no Key configured or deep research needed, use cloud_agent instead.
development
Get current weather and forecasts (no API key required).
tools
Send WhatsApp messages to other people or search/sync WhatsApp history via the wacli CLI (not for normal user chats).
tools
Start voice calls via the Moltbot voice-call plugin.