{"data":{"slug":"github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-result-export-chart-embedded-export-2dc9fd5826aa","title":"Structured Data Classification Analysis and Visualization","summary":"Extract classification distributions from structured data, perform cleaning and statistics, generate multi-dimensional cross-analysis, high-resolution comparison charts, and complete analysis reports, suitable for large file processing and embedded visualization scenarios.","url":"https:\/\/skillshunter.net\/skills\/github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-result-export-chart-embedded-export-2dc9fd5826aa","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-result-export-chart-embedded-export-2dc9fd5826aa","markdown_url":"https:\/\/skillshunter.net\/skills\/github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-result-export-chart-embedded-export-2dc9fd5826aa.md","download_url":"https:\/\/skillshunter.net\/skills\/github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-result-export-chart-embedded-export-2dc9fd5826aa\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"The skill requires structured data with a '\u5206\u7c7b\u5b57\u6bb5' (classification field) and a '\u6570\u503c\u5b57\u6bb5' (numerical field) for processing. The first deliverable is an Excel file with analysis results and a downloadable link.","instructions":"---\nname: chart-embedded-export\ndescription: \"\u4ece\u7ed3\u6784\u5316\u6570\u636e\u4e2d\u63d0\u53d6\u5206\u7c7b\u5206\u5e03\u6267\u884c\u6e05\u6d17\u4e0e\u7edf\u8ba1\uff0c\u751f\u6210\u591a\u7ef4\u5ea6\u4ea4\u53c9\u5206\u6790\u3001\u9ad8\u5206\u8fa8\u7387\u5bf9\u6bd4\u56fe\u8868\u53ca\u5305\u542b\u4e0b\u8f7d\u94fe\u63a5\u7684\u5b8c\u6574\u5206\u6790\u62a5\u544a\uff0c\u9002\u7528\u4e8e\u5927\u6587\u4ef6\u5904\u7406\u4e0e\u5d4c\u5165\u5f0f\u53ef\u89c6\u5316\u573a\u666f\u3002\"\n---\n\n## Skill Steps\n\n> This sub-skill covers one capability of the Excel workflow. For reading\/counting\/Parquet optimization, see the parent workflow SKILL.md.\n\nStep1 \u6267\u884c\u6570\u636e\u6e05\u6d17\uff0c\u5904\u7406\u5408\u5e76\u5355\u5143\u683c\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u6e05\u7406\u6587\u672c\uff0c\u5e76\u5efa\u7acb\u5206\u7c7b\u6620\u5c04\u51fd\u6570\u9aa8\u67b6\u3002\n```python\ntarget_col = '\u5206\u7c7b\u5b57\u6bb5'\nvalue_col = '\u6570\u503c\u5b57\u6bb5'\n\n# \u5408\u5e76\u5355\u5143\u683c\u5904\u7406 (\u5411\u4e0b\u586b\u5145\u8fd8\u539f)\ndf[target_col] = df[target_col].ffill()\n\n# \u6570\u636e\u6e05\u6d17\uff1a\u6b63\u5219\u53bb\u9664\u7279\u6b8a\u5b57\u7b26\u3001\u53bb\u7a7a\u3001\u7c7b\u578b\u8f6c\u6362\ndf[target_col] = df[target_col].astype(str).str.replace(r'[^\\w\\s]', '', regex=True).str.strip()\ndf[value_col] = pd.to_numeric(df[value_col], errors='coerce')\ndf = df.dropna(subset=[target_col, value_col])\n\n# \u5206\u7c7b\u6620\u5c04\u51fd\u6570\u9aa8\u67b6\ndef map_category(val):\n    if 'A\u7c7b\u7279\u5f81' in str(val): return 'Category_A'\n    elif 'B\u7c7b\u7279\u5f81' in str(val): return 'Category_B'\n    return 'Other'\n\ndf['Mapped_Category'] = df[target_col].apply(map_category)\n```\n\nStep2 \u8fdb\u884c\u591a\u7ef4\u5ea6\u7edf\u8ba1\u4e0e\u4ea4\u53c9\u5206\u6790\uff0c\u8ba1\u7b97\u5206\u7c7b\u5360\u6bd4\u5e76\u751f\u6210\u5305\u542b\u603b\u8ba1\u884c\u7684\u4ea4\u53c9\u8868\u3002\n```python\ngroup_col = '\u5206\u7ec4\u5b57\u6bb5'\n\n# value_counts \u7edf\u8ba1\u4e0e\u5360\u6bd4\u8ba1\u7b97\ncounts = df[group_col].value_counts()\nproportions = (counts \/ counts.sum() * 100).round(2)\n\n# \u4ea4\u53c9\u5206\u6790 (crosstab)\uff0c\u5305\u542b\u603b\u8ba1\u884c\ncross_analysis = pd.crosstab(df[group_col], df['Mapped_Category'], margins=True, margins_name='\u603b\u8ba1')\n\n# \u591a\u7ef4\u5ea6\u805a\u5408\u7edf\u8ba1\nstats = df.groupby(group_col)[value_col].agg(['sum', 'mean', 'min', 'max']).round(2)\n```\n\nStep3 \u6267\u884c\u4e1a\u52a1\u903b\u8f91\u8ba1\u7b97\uff08\u5982\u591a\u7ef4\u5ea6\u8bc4\u5206\u4e0e\u5206\u7ea7\uff09\uff0c\u5c06\u7ed3\u679c\u5bfc\u51fa\u4e3a Excel \u5e76\u751f\u6210\u6c99\u76d2\u4e0b\u8f7d\u94fe\u63a5\u3002\n```python\n# \u591a\u7ef4\u5ea6\u8bc4\u5206\/\u5206\u7ea7\u7b97\u6cd5\u7ed3\u6784\ndf['Score'] = df[value_col] * 1.5  # \u793a\u4f8b\u8ba1\u7b97\u903b\u8f91\ndf['Grade'] = pd.cut(df['Score'], bins=[0, 50, 80, 100], labels=['C', 'B', 'A'])\n\n# \u5bfc\u51fa\u7ed3\u6784\u5316\u7ed3\u679c\noutput_excel_path = 'analysis_result.xlsx'\ndf.to_excel(output_excel_path, index=False)\n\n# \u751f\u6210\u53ef\u70b9\u51fb\u7684\u4e0b\u8f7d\u94fe\u63a5\nprint(f\"\u5206\u6790\u7ed3\u679c\u5df2\u4fdd\u5b58\uff0c\u4e0b\u8f7d\u94fe\u63a5\uff1a[\u4e0b\u8f7d\u7ed3\u679c\u6570\u636e](sandbox:{output_excel_path})\")\n```\n\nStep4 \u914d\u7f6e\u4e2d\u82f1\u6587\u5b57\u4f53\uff0c\u751f\u6210\u5305\u542b\u997c\u56fe\u3001\u67f1\u72b6\u56fe\u3001\u7bb1\u7ebf\u56fe\u548c\u76f4\u65b9\u56fe\u7684\u7efc\u5408\u53ef\u89c6\u5316\u9762\u677f\uff0c\u5e76\u5bfc\u51fa\u9ad8\u5206\u8fa8\u7387\u53cc\u683c\u5f0f\u56fe\u7247\u3002\n```python\noutput_img_path = 'comprehensive_chart.png'\n\n# \u4e2d\u82f1\u6587\u5b57\u4f53\u914d\u7f6e\u4e0e\u56fe\u8868\u7f8e\u5316\nplt.rcParams['font.sans-serif'] = ['SimHei', 'DejaVu Sans', 'WenQuanYi Zen Hei']\nplt.rcParams['axes.unicode_minus'] = False\n\nfig, axes = plt.subplots(2, 2, figsize=(15, 12))\nfig.suptitle('\u591a\u7ef4\u5ea6\u6570\u636e\u5206\u5e03\u7efc\u5408\u5206\u6790', fontsize=16, fontweight='bold')\n\n# \u997c\u56fe\uff1a\u5206\u5e03\u6bd4\u4f8b\ncolors = ['#ff9999', '#66b3ff', '#99ff99', '#ffcc99']\naxes[0, 0].pie(counts.values, labels=counts.index, autopct='%1.1f%%', colors=colors, startangle=90)\naxes[0, 0].set_title('\u5206\u7ec4\u9009\u9879\u5206\u5e03\u6bd4\u4f8b')\n\n# \u67f1\u72b6\u56fe\uff1a\u4ea4\u53c9\u5206\u7c7b\u5206\u5e03\nplot_data = cross_analysis.drop('\u603b\u8ba1', axis=0, errors='ignore').drop('\u603b\u8ba1', axis=1, errors='ignore')\nplot_data.plot(kind='bar', ax=axes[0, 1], color=colors[:len(plot_data.columns)])\naxes[0, 1].set_title('\u4e0d\u540c\u5206\u7ec4\u4e0b\u5206\u7c7b\u5206\u5e03')\naxes[0, 1].tick_params(axis='x', rotation=45)\n\n# \u7bb1\u7ebf\u56fe\uff1a\u6570\u503c\u5206\u5e03\ndf.boxplot(column=value_col, by=group_col, ax=axes[1, 0])\naxes[1, 0].set_title('\u4e0d\u540c\u5206\u7ec4\u4e0b\u6570\u503c\u5206\u5e03')\n\n# \u76f4\u65b9\u56fe\uff1a\u9891\u6570\u5206\u5e03\nfor grp in df[group_col].dropna().unique():\n    subset = df[df[group_col] == grp]\n    axes[1, 1].hist(subset[value_col].dropna(), alpha=0.7, label=str(grp), bins=8)\naxes[1, 1].legend()\naxes[1, 1].set_title('\u6570\u503c\u5206\u5e03\u76f4\u65b9\u56fe')\n\nplt.tight_layout()\n# \u9ad8\u5206\u8fa8\u7387\u56fe\u50cf\u5bfc\u51fa\nplt.savefig(output_img_path, format='png', dpi=300)\nplt.savefig(output_img_path.replace('.png', '.svg'), format='svg')\nplt.close()\n```\n\nStep5 \u6574\u5408\u7edf\u8ba1\u6570\u636e\u4e0e\u56fe\u8868\u8def\u5f84\uff0c\u751f\u6210\u5305\u542b\u5173\u952e\u53d1\u73b0\u4e0e\u8be6\u7ec6\u6d1e\u5bdf\u7684\u5b8c\u6574 Markdown \u5206\u6790\u62a5\u544a\u3002\n```python\nreport = [\n    \"# \u6570\u636e\u7efc\u5408\u5206\u6790\u62a5\u544a\\n\",\n    \"## 1. \u5173\u952e\u53d1\u73b0\",\n    f\"- \u6570\u636e\u96c6\u5171\u5305\u542b {len(df)} \u6761\u6709\u6548\u8bb0\u5f55\u3002\",\n]\n\nfor idx, val in proportions.items():\n    report.append(f\"- \u5206\u7ec4 '{idx}' \u7684\u5360\u6bd4\u4e3a {val}%\u3002\")\n\nreport.extend([\n    \"\\n## 2. \u4ea4\u53c9\u5206\u6790\u6c47\u603b\",\n    cross_analysis.to_markdown(),\n    \"\\n## 3. \u805a\u5408\u7edf\u8ba1\u6307\u6807\",\n    stats.to_markdown(),\n    f\"\\n## 4. \u53ef\u89c6\u5316\u5206\u6790\\n![\u7efc\u5408\u5206\u6790\u56fe\u8868]({output_img_path})\\n\",\n    \"**\u7ed3\u8bba**: \u5404\u7c7b\u522b\u5728\u6570\u636e\u4e2d\u5448\u73b0\u7279\u5b9a\u5206\u5e03\u7279\u5f81\uff0c\u8be6\u7ec6\u660e\u7ec6\u4e0e\u8bc4\u5206\u5b9a\u7ea7\u7ed3\u679c\u8bf7\u53c2\u8003\u4e0a\u65b9\u4e0b\u8f7d\u94fe\u63a5\u83b7\u53d6\u5b8c\u6574\u9644\u4ef6\u3002\"\n])\n\nreport_content = '\\n'.join(report)\nprint(report_content)\n```\n","use_cases":["Perform classification statistics on sales data to generate sales distribution analysis reports by product categories.","Analyze user behavior data to generate behavior distribution and scoring results by user groups.","Clean and perform cross-analysis on market research data to generate visualization charts and detailed insights reports."],"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-result-export\/chart-embedded-export\/SKILL.md","source_commit":"07e7ff8c4bdfd7b79e7402fe94af59d2a5a9749b","license":null,"version":null,"listing_approved_at":"2026-11-16","created_at":"2026-11-15T09:42:11.000000Z","updated_at":"2026-11-16T05:16:30.000000Z","seo_title":"Structured Data Classification Analysis and Visualization Tool","seo_description":"Extract classification distributions from structured data, perform cleaning and statistics, generate multi-dimensional cross-analysis, high-resolution comparison charts,","seo_keywords":["Data Classification Analysis","Cross-Analysis Report","Data Cleaning and Statistics","Visualization Chart Generation","Multi-Dimensional Data Analysis"]}}