360 Secure SkillHub
360 安全技能中心

Data Analysis

该 Skill 指导对 CSV/Excel 数据文件进行探索与统计分析:读取数据、查看行列与缺失值、计算描述性统计与相关性,使用 matplotlib 生成柱状图、折线图、直方图和散点图,并按概览、关键指标、洞察、可视化、建议的格式输出结论,同时给出缺失值、日期解析和大文件分块处理的注意事项。

分类:数据
di5cip1e
di5cip1e
热度 48.48
最近更新 2026-05-11 17:41:04

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add di5cip1e/director-data-analysis
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
data-analysis
description
Analyze CSV/Excel files to extract insights, generate statistics, create charts, and produce summaries. Use when user wants to (1) upload or analyze spreadsheet data, (2) get insights from data files, (3) generate charts or visualizations, (4) calculate statistics or trends, (5) clean or transform data.

Data Analysis Skill

Analyze data files (CSV, Excel) and produce actionable insights.

Quick Start

  1. Read the file - Use appropriate library:

    • CSV: csv module or pandas.read_csv()
    • Excel: pandas.read_excel() with openpyxl engine
  2. Explore the data - Get shape, columns, dtypes, missing values

  3. Generate insights - Calculate:

    • Descriptive stats (mean, median, mode, std, min, max)
    • Correlations between numeric columns
    • Value counts for categorical columns
    • Trends over time if date column exists
  4. Create visualizations - Use matplotlib:

    • Bar charts for categorical data
    • Line charts for time series
    • Histograms for distributions
    • Scatter plots for correlations
  5. Summarize - Write findings in plain English

Common Patterns

Sales Data

import pandas as pd

df = pd.read_csv('sales.csv')
summary = {
    'total_revenue': df['amount'].sum(),
    'avg_order': df['amount'].mean(),
    'top_products': df['product'].value_counts().head(5),
    'monthly_trend': df.groupby(pd.to_datetime(df['date']).dt.month)['amount'].sum()
}

Customer Data

demographics = df.groupby('segment').agg({
    'age': ['mean', 'median'],
    'income': ['mean', 'std'],
    'id': 'count'
})

Time Series

df['date'] = pd.to_datetime(df['date'])
monthly = df.resample('M', on='date')['value'].sum()

Output Format

Always include:

  1. Overview - What the data contains (rows, columns, date range)
  2. Key Metrics - Top 5-10 actionable numbers
  3. Insights - 3-5 bullet points of what the data reveals
  4. Visualizations - At least 2 charts for any dataset with 100+ rows
  5. Recommendations - Suggested next steps based on findings

Error Handling

  • Handle missing values: df.fillna(0) or df.dropna()
  • Handle date parsing: Use pd.to_datetime(..., errors='coerce')
  • Handle large files: Process in chunks for files >100MB