본문으로 건너뛰기
cccskills
무료GitHub에 공개

trend-analysis

Group Excel figures by department or product line, assign performance tiers, and calculate projections using growth rates set for each tier. Compare current and projected values in charts and summarize overall growth for target setting.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

基于多维度数据进行分级评估与趋势预测,通过设定差异化增长率计算预测值,并生成对比可视化图表,适用于绩效评估、目标设定等场景。

설치 방법 보기

이럴 때 유용합니다

  • Setting sales targets by department
  • Estimating production targets by product line
  • Comparing projections under tier-specific growth assumptions
  • Charting current values against projected targets

포함된 파일(1)

  • SKILL.md4.2 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Step1 加载数据并配置环境,设置中文字体以确保可视化图表正常显示。

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')

# 设置中文字体,优先使用 WenQuanYi Zen Hei,备选 SimHei 和 DejaVu Sans
plt.rcParams['font.sans-serif'] = ['WenQuanYi Zen Hei', 'SimHei', 'DejaVu Sans']
plt.rcParams['axes.unicode_minus'] = False

# 加载数据文件
file_path = 'your_data.xlsx'
df = pd.read_excel(file_path)

print(f"数据形状: {df.shape}")
df.head()

Step2 基于数据表现划分等级并设定差异化增长率,计算预测结果。

# 定义通用列名
group_col = '分组列名'  # 示例:'部门'、'产品线'
target_col = '目标数值列名'  # 示例:'销售额'、'产量'

# 计算各维度的总值并排序
performance_data = df.groupby(group_col, as_index=False)[target_col].sum().sort_values(by=target_col, ascending=False)

# 划分等级(前30%为高,后30%为低,其余为中等)
n = len(performance_data)
high_perf_threshold = int(0.3 * n)
low_perf_threshold = int(0.7 * n)

performance_data['等级'] = '中等'
performance_data.loc[:high_perf_threshold-1, '等级'] = '高'
performance_data.loc[low_perf_threshold:, '等级'] = '低'

# 设定预测增长率映射字典
growth_rate_map = {
    '高': 0.10,   # 10% 增长率
    '中等': 0.08, # 8% 增长率
    '低': 0.15    # 15% 增长率
}
performance_data['预测增长率'] = performance_data['等级'].map(growth_rate_map)

# 计算预测值 = 当前值 × (1 + 增长率),保留两位小数
performance_data['预测值'] = (performance_data[target_col] * (1 + performance_data['预测增长率'])).round(2)
performance_data[[group_col, target_col, '预测增长率', '预测值']].head()

Step3 综合分析预测结果,计算整体趋势指标并生成结论。

# 计算整体指标
current_total = performance_data[target_col].sum()
forecast_total = performance_data['预测值'].sum()
growth_rate_total = (forecast_total - current_total) / current_total if current_total != 0 else 0

print(f"当前总计: {current_total:,.2f}")
print(f"预测总计: {forecast_total:,.2f}")
print(f"整体增长率: {growth_rate_total:.2%}")

# 输出趋势结论
if growth_rate_total > 0.1:
    conclusion = "整体趋势向好,预计实现显著增长。"
elif growth_rate_total > 0:
    conclusion = "整体呈温和增长态势。"
else:
    conclusion = "整体面临压力,需重点关注低绩效部分。"

print(f"趋势结论:{conclusion}")

Step4 可视化展示预测结果,通过横向柱状图对比当前与预测值,并标注等级与数值。

# 设置图形大小与高分辨率
plt.figure(figsize=(12, 8), dpi=100)

# 横向柱状图:当前与预测值对比
x_pos = np.arange(len(performance_data))
width = 0.35

plt.barh(x_pos - width/2, performance_data[target_col], width, label='当前值', color='skyblue', edgecolor='black', alpha=0.8)
plt.barh(x_pos + width/2, performance_data['预测值'], width, label='预测值', color='lightcoral', edgecolor='black', alpha=0.8)

# 添加数值标签
for i, (current, forecast) in enumerate(zip(performance_data[target_col], performance_data['预测值'])):
    plt.text(current, i - width/2, f" {current:,.0f}", va='center', fontsize=9, color='black')
    plt.text(forecast, i + width/2, f" {forecast:,.0f}", va='center', fontsize=9, color='black')

# 添加等级标签到 Y 轴
for i, level in enumerate(performance_data['等级']):
    plt.text(0, i, f"({level}) ", va='center', ha='right', fontsize=9, color='gray', transform=plt.gca().get_yaxis_transform())

# 设置标题与标签
plt.xlabel(f'{target_col}')
plt.ylabel(f'{group_col}')
plt.title(f'各{group_col}当前与预测{target_col}对比', fontsize=14, fontweight='bold')
plt.yticks(x_pos, performance_data[group_col])
plt.legend()
plt.grid(axis='x', linestyle='--', alpha=0.5)

# 调整布局并显示
plt.tight_layout()
plt.show()

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Compare counts and shares for two categories in Excel data. The skill cleans the selected columns, calculates differences and percentages, and produces a summary spreadsheet plus bar and pie charts.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Comparing counts for two categories
  • Visualizing category shares
  • Cleaning merged-cell data before counting
OpenSenseNova/SenseNova-Skills5.8천2026년 10월 9일 업데이트

Analyze Excel data using custom categories, count distributions, and compare groups with charts. Score text using its length, technical terms, numbers, and selected complex concepts, then visualize difficulty levels and the relationship between text length and scores.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Summarize Excel records using custom categories
  • Compare category distributions across groups
  • Score and grade text using adjustable rules
OpenSenseNova/SenseNova-Skills5.8천2026년 10월 9일 업데이트

Count categories in a chosen data column after removing missing values and placeholder labels. Calculate each category’s share and create high-resolution charts combining counts, percentages, pie charts, and horizontal bars for distribution reports.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Compare record counts across categories
  • Show category shares with pie and bar charts
  • Exclude placeholder labels before counting
OpenSenseNova/SenseNova-Skills5.8천2026년 10월 9일 업데이트

Clean category and numeric fields in structured data, compare groups with counts and cross-tabulations, and produce charts, Excel results, and a Markdown report. Export visuals as high-resolution PNG and SVG files for use in reports.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Compare category distributions across groups
  • Clean category labels and fill merged-cell gaps
  • Export analysis results to Excel
OpenSenseNova/SenseNova-Skills5.8천2026년 10월 9일 업데이트

Filter Excel data using candidate column names, RGB color values, text prefixes, and regular expressions, which match text patterns. Calculate totals and averages, then export results to Excel with highlighted rows and a download link.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Filtering rows by RGB values or identifier prefixes
  • Converting text to numbers and calculating totals or averages
  • Extracting matching commands with their identifiers and descriptions
OpenSenseNova/SenseNova-Skills5.8천2026년 10월 9일 업데이트

Filter rows from Excel or previously converted Parquet files, a format designed for efficient data storage. Summarize matching records by group with counts, percentages, and totals, then export the summary to Excel.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Count records containing a specified risk level by work category
  • Calculate group shares among matching records
  • Summarize large datasets already converted to Parquet
OpenSenseNova/SenseNova-Skills5.8천2026년 10월 9일 업데이트

OpenSenseNova의 스킬 모두 보기

이 스킬의 문제 신고