{"data":{"slug":"github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-data-analysis-trend-analysis-cd55a99a0924","title":"Trend Analysis","summary":"Perform graded evaluation and trend prediction based on multi-dimensional data, calculate predicted values using differentiated growth rates, and generate comparative visual charts, suitable for performance evaluation, goal setting, and other scenarios.","url":"https:\/\/skillshunter.net\/skills\/github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-data-analysis-trend-analysis-cd55a99a0924","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-data-analysis-trend-analysis-cd55a99a0924","markdown_url":"https:\/\/skillshunter.net\/skills\/github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-data-analysis-trend-analysis-cd55a99a0924.md","download_url":"https:\/\/skillshunter.net\/skills\/github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-data-analysis-trend-analysis-cd55a99a0924\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"The tool requires the user to prepare a data file in Excel format (e.g., 'your_data.xlsx') and set up the environment with appropriate fonts for Chinese display.","instructions":"---\nname: trend-analysis\ndescription: \"\u57fa\u4e8e\u591a\u7ef4\u5ea6\u6570\u636e\u8fdb\u884c\u5206\u7ea7\u8bc4\u4f30\u4e0e\u8d8b\u52bf\u9884\u6d4b\uff0c\u901a\u8fc7\u8bbe\u5b9a\u5dee\u5f02\u5316\u589e\u957f\u7387\u8ba1\u7b97\u9884\u6d4b\u503c\uff0c\u5e76\u751f\u6210\u5bf9\u6bd4\u53ef\u89c6\u5316\u56fe\u8868\uff0c\u9002\u7528\u4e8e\u7ee9\u6548\u8bc4\u4f30\u3001\u76ee\u6807\u8bbe\u5b9a\u7b49\u573a\u666f\u3002\"\n---\n\nStep1 \u52a0\u8f7d\u6570\u636e\u5e76\u914d\u7f6e\u73af\u5883\uff0c\u8bbe\u7f6e\u4e2d\u6587\u5b57\u4f53\u4ee5\u786e\u4fdd\u53ef\u89c6\u5316\u56fe\u8868\u6b63\u5e38\u663e\u793a\u3002\n```python\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport warnings\nwarnings.filterwarnings('ignore')\n\n# \u8bbe\u7f6e\u4e2d\u6587\u5b57\u4f53\uff0c\u4f18\u5148\u4f7f\u7528 WenQuanYi Zen Hei\uff0c\u5907\u9009 SimHei \u548c DejaVu Sans\nplt.rcParams['font.sans-serif'] = ['WenQuanYi Zen Hei', 'SimHei', 'DejaVu Sans']\nplt.rcParams['axes.unicode_minus'] = False\n\n# \u52a0\u8f7d\u6570\u636e\u6587\u4ef6\nfile_path = 'your_data.xlsx'\ndf = pd.read_excel(file_path)\n\nprint(f\"\u6570\u636e\u5f62\u72b6: {df.shape}\")\ndf.head()\n```\n\nStep2 \u57fa\u4e8e\u6570\u636e\u8868\u73b0\u5212\u5206\u7b49\u7ea7\u5e76\u8bbe\u5b9a\u5dee\u5f02\u5316\u589e\u957f\u7387\uff0c\u8ba1\u7b97\u9884\u6d4b\u7ed3\u679c\u3002\n```python\n# \u5b9a\u4e49\u901a\u7528\u5217\u540d\ngroup_col = '\u5206\u7ec4\u5217\u540d'  # \u793a\u4f8b\uff1a'\u90e8\u95e8'\u3001'\u4ea7\u54c1\u7ebf'\ntarget_col = '\u76ee\u6807\u6570\u503c\u5217\u540d'  # \u793a\u4f8b\uff1a'\u9500\u552e\u989d'\u3001'\u4ea7\u91cf'\n\n# \u8ba1\u7b97\u5404\u7ef4\u5ea6\u7684\u603b\u503c\u5e76\u6392\u5e8f\nperformance_data = df.groupby(group_col, as_index=False)[target_col].sum().sort_values(by=target_col, ascending=False)\n\n# \u5212\u5206\u7b49\u7ea7\uff08\u524d30%\u4e3a\u9ad8\uff0c\u540e30%\u4e3a\u4f4e\uff0c\u5176\u4f59\u4e3a\u4e2d\u7b49\uff09\nn = len(performance_data)\nhigh_perf_threshold = int(0.3 * n)\nlow_perf_threshold = int(0.7 * n)\n\nperformance_data['\u7b49\u7ea7'] = '\u4e2d\u7b49'\nperformance_data.loc[:high_perf_threshold-1, '\u7b49\u7ea7'] = '\u9ad8'\nperformance_data.loc[low_perf_threshold:, '\u7b49\u7ea7'] = '\u4f4e'\n\n# \u8bbe\u5b9a\u9884\u6d4b\u589e\u957f\u7387\u6620\u5c04\u5b57\u5178\ngrowth_rate_map = {\n    '\u9ad8': 0.10,   # 10% \u589e\u957f\u7387\n    '\u4e2d\u7b49': 0.08, # 8% \u589e\u957f\u7387\n    '\u4f4e': 0.15    # 15% \u589e\u957f\u7387\n}\nperformance_data['\u9884\u6d4b\u589e\u957f\u7387'] = performance_data['\u7b49\u7ea7'].map(growth_rate_map)\n\n# \u8ba1\u7b97\u9884\u6d4b\u503c = \u5f53\u524d\u503c \u00d7 (1 + \u589e\u957f\u7387)\uff0c\u4fdd\u7559\u4e24\u4f4d\u5c0f\u6570\nperformance_data['\u9884\u6d4b\u503c'] = (performance_data[target_col] * (1 + performance_data['\u9884\u6d4b\u589e\u957f\u7387'])).round(2)\nperformance_data[[group_col, target_col, '\u9884\u6d4b\u589e\u957f\u7387', '\u9884\u6d4b\u503c']].head()\n```\n\nStep3 \u7efc\u5408\u5206\u6790\u9884\u6d4b\u7ed3\u679c\uff0c\u8ba1\u7b97\u6574\u4f53\u8d8b\u52bf\u6307\u6807\u5e76\u751f\u6210\u7ed3\u8bba\u3002\n```python\n# \u8ba1\u7b97\u6574\u4f53\u6307\u6807\ncurrent_total = performance_data[target_col].sum()\nforecast_total = performance_data['\u9884\u6d4b\u503c'].sum()\ngrowth_rate_total = (forecast_total - current_total) \/ current_total if current_total != 0 else 0\n\nprint(f\"\u5f53\u524d\u603b\u8ba1: {current_total:,.2f}\")\nprint(f\"\u9884\u6d4b\u603b\u8ba1: {forecast_total:,.2f}\")\nprint(f\"\u6574\u4f53\u589e\u957f\u7387: {growth_rate_total:.2%}\")\n\n# \u8f93\u51fa\u8d8b\u52bf\u7ed3\u8bba\nif growth_rate_total > 0.1:\n    conclusion = \"\u6574\u4f53\u8d8b\u52bf\u5411\u597d\uff0c\u9884\u8ba1\u5b9e\u73b0\u663e\u8457\u589e\u957f\u3002\"\nelif growth_rate_total > 0:\n    conclusion = \"\u6574\u4f53\u5448\u6e29\u548c\u589e\u957f\u6001\u52bf\u3002\"\nelse:\n    conclusion = \"\u6574\u4f53\u9762\u4e34\u538b\u529b\uff0c\u9700\u91cd\u70b9\u5173\u6ce8\u4f4e\u7ee9\u6548\u90e8\u5206\u3002\"\n\nprint(f\"\u8d8b\u52bf\u7ed3\u8bba\uff1a{conclusion}\")\n```\n\nStep4 \u53ef\u89c6\u5316\u5c55\u793a\u9884\u6d4b\u7ed3\u679c\uff0c\u901a\u8fc7\u6a2a\u5411\u67f1\u72b6\u56fe\u5bf9\u6bd4\u5f53\u524d\u4e0e\u9884\u6d4b\u503c\uff0c\u5e76\u6807\u6ce8\u7b49\u7ea7\u4e0e\u6570\u503c\u3002\n```python\n# \u8bbe\u7f6e\u56fe\u5f62\u5927\u5c0f\u4e0e\u9ad8\u5206\u8fa8\u7387\nplt.figure(figsize=(12, 8), dpi=100)\n\n# \u6a2a\u5411\u67f1\u72b6\u56fe\uff1a\u5f53\u524d\u4e0e\u9884\u6d4b\u503c\u5bf9\u6bd4\nx_pos = np.arange(len(performance_data))\nwidth = 0.35\n\nplt.barh(x_pos - width\/2, performance_data[target_col], width, label='\u5f53\u524d\u503c', color='skyblue', edgecolor='black', alpha=0.8)\nplt.barh(x_pos + width\/2, performance_data['\u9884\u6d4b\u503c'], width, label='\u9884\u6d4b\u503c', color='lightcoral', edgecolor='black', alpha=0.8)\n\n# \u6dfb\u52a0\u6570\u503c\u6807\u7b7e\nfor i, (current, forecast) in enumerate(zip(performance_data[target_col], performance_data['\u9884\u6d4b\u503c'])):\n    plt.text(current, i - width\/2, f\" {current:,.0f}\", va='center', fontsize=9, color='black')\n    plt.text(forecast, i + width\/2, f\" {forecast:,.0f}\", va='center', fontsize=9, color='black')\n\n# \u6dfb\u52a0\u7b49\u7ea7\u6807\u7b7e\u5230 Y \u8f74\nfor i, level in enumerate(performance_data['\u7b49\u7ea7']):\n    plt.text(0, i, f\"({level}) \", va='center', ha='right', fontsize=9, color='gray', transform=plt.gca().get_yaxis_transform())\n\n# \u8bbe\u7f6e\u6807\u9898\u4e0e\u6807\u7b7e\nplt.xlabel(f'{target_col}')\nplt.ylabel(f'{group_col}')\nplt.title(f'\u5404{group_col}\u5f53\u524d\u4e0e\u9884\u6d4b{target_col}\u5bf9\u6bd4', fontsize=14, fontweight='bold')\nplt.yticks(x_pos, performance_data[group_col])\nplt.legend()\nplt.grid(axis='x', linestyle='--', alpha=0.5)\n\n# \u8c03\u6574\u5e03\u5c40\u5e76\u663e\u793a\nplt.tight_layout()\nplt.show()\n```\n","use_cases":["Performance Evaluation: Analyze the current performance and future growth prediction of different departments or product lines.","Goal Setting: Set reasonable target values based on historical data and trend predictions.","Resource Allocation: Identify high-performing and low-performing areas to optimize resource allocation strategies."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/OpenSenseNova\/SenseNova-Skills\/blob\/07e7ff8c4bdfd7b79e7402fe94af59d2a5a9749b\/skills\/sn-da-excel-workflow\/capability\/excel-data-analysis\/trend-analysis\/SKILL.md","source_commit":"07e7ff8c4bdfd7b79e7402fe94af59d2a5a9749b","license":null,"version":null,"listing_approved_at":"2026-11-16","created_at":"2026-11-15T07:58:14.000000Z","updated_at":"2026-11-16T05:16:30.000000Z","seo_title":"Trend Analysis Tool: Data Grading and Predictive Visualization","seo_description":"Perform graded evaluation and trend prediction based on multi-dimensional data, calculate predicted values using differentiated growth rates, and generate comparative vis","seo_keywords":["Trend Analysis Tool","Data Grading Prediction","Performance Evaluation Analysis","Visual Trend Charts","Growth Prediction Model"]}}