{"data":{"slug":"github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-reading-multi-file-reading-ba32fd3bb054","title":"Excel File Row Count and Categorization Analysis","summary":"This skill reads multi-sheet Excel files, counts rows in each sheet, and evaluates data scale. It also supports categorization data statistics and visualization report generation.","url":"https:\/\/skillshunter.net\/skills\/github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-reading-multi-file-reading-ba32fd3bb054","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-reading-multi-file-reading-ba32fd3bb054","markdown_url":"https:\/\/skillshunter.net\/skills\/github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-reading-multi-file-reading-ba32fd3bb054.md","download_url":"https:\/\/skillshunter.net\/skills\/github-opensensenova-sensenova-skills-skills-sn-da-excel-workflow-capability-excel-reading-multi-file-reading-ba32fd3bb054\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"The skill requires a valid Excel file path and a target column for categorization analysis. It generates a summary table and a pie chart for data distribution, along with downloadable Excel reports.","instructions":"---\nname: multi-file-excel-parquet-analysis\ndescription: \"\u8bfb\u53d6\u591a Sheet Excel \u6587\u4ef6\u5e76\u7edf\u8ba1\u89c4\u6a21\uff0c\u652f\u6301\u5927\u6587\u4ef6\u5411 Parquet \u683c\u5f0f\u8f6c\u6362\u3001\u5206\u7c7b\u6570\u636e\u7edf\u8ba1\u53ca\u53ef\u89c6\u5316\u62a5\u544a\u751f\u6210\u3002\"\n---\n\n\n> **Note**: This sub-skill covers one step of the Excel analysis workflow. For the full pipeline (file reading, row counting, large-file optimization, export), see the parent workflow SKILL.md.\n\n\nStep1 \u8bfb\u53d6 Excel \u6587\u4ef6\uff0c\u904d\u5386\u6240\u6709 Sheet \u7edf\u8ba1\u884c\u6570\uff0c\u8bc4\u4f30\u6570\u636e\u89c4\u6a21\u3002\n```python\nimport pandas as pd\nimport os\n\nfile_path = \"input_data.xlsx\"  # \u66ff\u6362\u4e3a\u5b9e\u9645\u6587\u4ef6\u8def\u5f84\n\nif not os.path.exists(file_path):\n    print(f\"Error: \u6587\u4ef6 {file_path} \u4e0d\u5b58\u5728\")\nelse:\n    # \u83b7\u53d6\u6240\u6709 sheet \u540d\u79f0\n    xl = pd.ExcelFile(file_path)\n    sheet_names = xl.sheet_names\n    print(\"Sheet \u5217\u8868:\", sheet_names)\n    \n    total_rows = 0\n    for sheet in sheet_names:\n        # \u4ec5\u8bfb\u53d6\u7b2c\u4e00\u5217\u4ee5\u5feb\u901f\u7edf\u8ba1\u884c\u6570\uff0c\u907f\u514d\u5927\u6587\u4ef6\u5185\u5b58\u6ea2\u51fa\n        df_tmp = pd.read_excel(file_path, sheet_name=sheet, usecols=[0])\n        row_count = len(df_tmp)\n        total_rows += row_count\n        print(f\"Sheet: {sheet}, \u884c\u6570: {row_count}\")\n    \n    print(f\"\u603b\u884c\u6570\u6c47\u603b: {total_rows}\")\n```\n\nStep2 \u8bfb\u53d6\u8f6c\u6362\u540e\u7684\u6570\u636e\uff0c\u6267\u884c\u5206\u7c7b\u7edf\u8ba1\u5206\u6790\uff0c\u8ba1\u7b97\u9891\u6570\u4e0e\u5360\u6bd4\u3002\n```python\nimport pandas as pd\n\n# \u8bfb\u53d6 Parquet \u6587\u4ef6\ndf_analyzed = pd.read_parquet(output_parquet)\n\n# \u5b9a\u4e49\u76ee\u6807\u7edf\u8ba1\u5217\uff08\u5982 '\u526a\u88c1\u7ed3\u679c'\u3001'\u72b6\u6001' \u7b49\uff09\ntarget_col = '\u526a\u88c1\u7ed3\u679c' \n\nif target_col in df_analyzed.columns:\n    # \u7edf\u8ba1\u5404\u5206\u7c7b\u6570\u91cf\u53ca\u5360\u6bd4\n    counts = df_analyzed[target_col].value_counts()\n    percent = df_analyzed[target_col].value_counts(normalize=True) * 100\n    \n    # \u6784\u5efa\u7edf\u8ba1\u8868\u683c\u5e76\u6dfb\u52a0\u603b\u8ba1\u884c\n    summary_df = pd.DataFrame({\n        '\u5206\u7c7b': counts.index,\n        '\u6570\u91cf': counts.values,\n        '\u5360\u6bd4(%)': percent.values.round(2)\n    })\n    \n    # \u6dfb\u52a0\u603b\u8ba1\u884c\n    total_row = pd.DataFrame([['\u603b\u8ba1', summary_df['\u6570\u91cf'].sum(), 100.0]], columns=summary_df.columns)\n    summary_df = pd.concat([summary_df, total_row], ignore_index=True)\n    \n    print(\"\u7edf\u8ba1\u6458\u8981:\\n\", summary_df)\nelse:\n    print(f\"\u672a\u627e\u5230\u76ee\u6807\u5217: {target_col}\")\n```\n\nStep3 \u751f\u6210\u53ef\u89c6\u5316\u997c\u56fe\u5e76\u4fdd\u5b58\u5206\u6790\u62a5\u544a\uff0c\u63d0\u4f9b\u7ed3\u679c\u4e0b\u8f7d\u94fe\u63a5\u3002\n```python\nimport matplotlib.pyplot as plt\n\n# \u914d\u7f6e\u4e2d\u6587\u5b57\u4f53\uff08\u5b9e\u6218\u6280\u5de7\uff1a\u9632\u6b62\u56fe\u8868\u4e71\u7801\uff09\nplt.rcParams['font.sans-serif'] = ['SimHei', 'DejaVu Sans']\nplt.rcParams['axes.unicode_minus'] = False\n\nif target_col in df_analyzed.columns:\n    # \u7ed8\u5236\u997c\u56fe\n    plt.figure(figsize=(10, 7), dpi=100)\n    plot_data = df_analyzed[target_col].value_counts()\n    plt.pie(plot_data, labels=plot_data.index, autopct='%1.1f%%', startangle=90, colors=plt.cm.Paired.colors)\n    plt.title(f'{target_col} \u5206\u5e03\u5360\u6bd4')\n    \n    # \u4fdd\u5b58\u56fe\u8868\n    chart_output = \"analysis_pie_chart.png\"\n    plt.savefig(chart_output, bbox_inches='tight')\n    \n    # \u4fdd\u5b58\u7edf\u8ba1\u7ed3\u679c\u4e3a Excel\n    report_output = \"analysis_report.xlsx\"\n    summary_df.to_excel(report_output, index=False)\n    \n    print(f\"\u5206\u6790\u56fe\u8868\u5df2\u4fdd\u5b58: {chart_output}\")\n    print(f\"\u7edf\u8ba1\u8868\u683c\u5df2\u4fdd\u5b58: {report_output}\")\n    \n    # \u751f\u6210\u4e0b\u8f7d\u94fe\u63a5\uff08\u7528\u4e8e\u62a5\u544a\u5c55\u793a\uff09\n    print(f\"\u4e0b\u8f7d\u94fe\u63a5: {os.path.abspath(report_output)}\")\n```\n","use_cases":["Count rows in multiple worksheets to assess file size","Analyze the distribution ratio of categorized data (e.g., 'Cropping Results')","Generate visualization pie charts and statistical reports for data presentation"],"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-reading\/multi-file-reading\/SKILL.md","source_commit":"07e7ff8c4bdfd7b79e7402fe94af59d2a5a9749b","license":null,"version":null,"listing_approved_at":"2026-11-16","created_at":"2026-11-15T09:16:41.000000Z","updated_at":"2026-11-16T05:16:30.000000Z","seo_title":"Excel File Row Count and Categorization Analysis Tool","seo_description":"Quickly count rows in multi-sheet Excel files and generate categorization analysis reports, supporting visualization charts and download links.","seo_keywords":["Excel Row Count","Multi-Sheet Data Analysis","Categorized Data Statistics","Excel Report Generation","Data Visualization Charts"]}}