large-excel-analysis-and-formatting
用于处理多Sheet大型Excel文件,支持大文件Parquet格式转换提速,并使用openpyxl生成带条件高亮和自定义样式的格式化Excel报告及下载链接。
npx skills add OpenSenseNova/SenseNova-Skills --skill large-excel-reading --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
## Skill Steps Step1 读取Excel文件,统计所有Sheet的总行数。若数据量过大(如≥1万行),则转换为Parquet格式以显著提升后续读取和分析效率。 ```python import pandas as pd file_path = "input.xlsx" xls = pd.ExcelFile(file_path) total_rows = 0 # 统计所有 sheet 的总行数 for name in xls.sheet_names: df_temp = pd.read_excel(file_path, sheet_name=name, header=None) total_rows += len(df_temp) print(f"总行数: {total_rows}") # 大文件处理:超过阈值转换为 Parquet 提升效率 if total_rows >= 10000: parquet_path = "/mnt/data/temp.parquet" # 此处以读取第一个sheet为例,实际可根据需求合并多个sheet df = pd.read_excel(file_path, sheet_name=0) df.to_parquet(engine='pyarrow', path=parquet_path) df = pd.read_parquet(parquet_path) else: df = pd.read_excel(file_path, sheet_name=0) ``` Step2 提取目标数据进行分组汇总分析,并识别出最大值及其对应的分类项。 ```python # 占位示例:根据实际数据集替换列名 group_col = '分类列名' # 如 '控股类型' target_col = '目标数值列' # 如 '建筑业总产值' # 假设 df 已清洗并包含所需列,进行汇总分析 summary = df.groupby(group_col)[target_col].sum().reset_index() # 识别最大值及其对应的分类 max_idx = summary[target_col].idxmax() max_type = summary.loc[max_idx, group_col] print(f"最高产值类型: {max_type}") ``` Step3 使用 openpyxl 将分析结果写入新的Excel文件,配置表头样式、边框、列宽,并对满足特定条件(如最大值)的行进行绿色高亮标注,最后生成下载链接。 ```python from openpyxl import Workbook from openpyxl.styles import PatternFill, Font, Alignment, Bo
- Skill Steps
What does the large-excel-analysis-and-formatting skill do?
用于处理多Sheet大型Excel文件,支持大文件Parquet格式转换提速,并使用openpyxl生成带条件高亮和自定义样式的格式化Excel报告及下载链接。
How do I install it?
Run `npx skills add OpenSenseNova/SenseNova-Skills --skill large-excel-reading --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From OpenSenseNova/SenseNova-Skills, a repository with 4,855 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
