/category-coloring
当Excel文件总行数超过1万行时,通过转换为Parquet格式提升读取性能,提取目标指标并计算最大值,最后将结果输出为Excel并对特定行进行高亮标注。
$ npx -y skills add OpenSenseNova/SenseNova-Skills --skill category-coloring --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/category-coloring
Context preview
The summary Claude sees to decide when to auto-load this skill.
当Excel文件总行数超过1万行时,通过转换为Parquet格式提升读取性能,提取目标指标并计算最大值,最后将结果输出为Excel并对特定行进行高亮标注。
SKILL.md
category-coloring.SKILL.mdname: large-file-parquet-analysis-and-highlight
description: "当Excel文件总行数超过1万行时,通过转换为Parquet格式提升读取性能,提取目标指标并计算最大值,最后将结果输出为Excel并对特定行进行高亮标注。"
Skill Steps
Step1 读取文件并统计所有 sheet 的行数,汇总后打印总行数,用于判断数据规模是否需要启用大文件处理。
import pandas as pd
file_path = "input_data.xlsx"
# 读取所有sheet并统计总行数
xls = pd.ExcelFile(file_path)
sheet_names = xls.sheet_names
print(f"Sheet列表: {sheet_names}")
total_rows = 0
for sheet in sheet_names:
# 仅读取一列以加快行数统计速度
df_temp = pd.read_excel(file_path, sheet_name=sheet, usecols=[0], header=None)
rows = len(df_temp)
total_rows += rows
print(f"Sheet '{sheet}': {rows} 行")
print(f"\n总行数 = {total_rows}")Step2 当总行数 ≥ 1万时,读取已转换为 Parquet 格式的数据文件,通过行列匹配提取目标指标数据,并找出最大值及其对应分类。
import pandas as pd
# 假设已通过大文件处理技能将Excel转换为Parquet
parquet_path = "converted_data.parquet"
df = pd.read_parquet(parquet_path)
# 假设第2行(索引1)是分类表头(如:控股类型、区域等)
header_row = df.iloc[1].tolist()
print("分类表头:", header_row)
# 找到目标指标所在的行(占位示例:'目标指标名称')
target_metric = '目标指标名称'
target_rows = df[df[0] == target_metric]
if not target_rows.empty:
# 提取数值
values = target_rows.iloc[0, 1:].tolist()
# 清洗数据并找出最大值及其对应的分类
numeric_values = []
for val in values:
try:
numeric_values.append(float(val))
except:
numeric_values.append(0)
max_val = max(numeric_values)
max_idx = numeric_values.index(max_val)
max_type = header_row[1:][max_idx]
print(f"\n指标最高的分类: {max_type} ({max_val})")
# 准备写入Excel的数据结构
result_data = list(zip(header_row[1:], numeric_values))Step3 将提取的分析结果保存为新的 Excel 文件,并使用 openpyxl 对最大值所在行进行背景色高亮标注,最后验证输出。
from openpyxl import Workbook
from openpyxl.styles import PatternFill
from openpyxl import load_workbook
output_path = "analysis_result.xlsx"
wb = Workbook()
ws = wb.active
ws.title = "数据分析结果"
# 写入表头
headers = ["分类类型", "指标数值"]
ws.append(headers)
# 写入数据 (使用Step2提取的 result_data,此处为防空值做备用示例)
if 'result_data' not in locals():
result_data = [("分类A", 100), ("分类B", 500), ("分类C", 200)]
max_type = "分类B"
for row in result_data:
ws.append(row)
# 找到最大值所在行并标绿
green_fill = PatternFill(start_color="00FF00", end_color="00FF00", fill_type="solid")
for row in ws.iter_rows(min_row=2, max_row=ws.max_row):
if row[0].value == max_type:
for cell in row:
cell.fill = green_fill
# 保存文件
wb.save(output_path)
print(f"文件已保存到: {output_path}")
# 验证输出文件内容及格式
wb_check = load_workbook(output_path)
ws_check = wb_check.active
print("\n文件内容验证:")
for row in ws_check.iter_rows(values_only=True):
print(row)Read more
name: large-file-parquet-analysis-and-highlight description: "当Excel文件总行数超过1万行时,通过转换为Parquet格式提升读取性能,提取目标指标并计算最大值,最后将结果输出为Excel并对特定行进行高亮标注。"
Skill Steps
Step1 读取文件并统计所有 sheet 的行数,汇总后打印总行数,用于判断数据规模是否需要启用大文件处理。
import pandas as pd
file_path = "input_data.xlsx"
# 读取所有sheet并统计总行数
xls = pd.ExcelFile(file_path)
sheet_names = xls.sheet_names
print(f"Sheet列表: {sheet_names}")
total_rows = 0
for sheet in sheet_names:
# 仅读取一列以加快行数统计速度
df_temp = pd.read_excel(file_path, sheet_name=sheet, usecols=[0], header=None)
rows = len(df_temp)
total_rows += rows
print(f"Sheet '{sheet}': {rows} 行")
print(f"\n总行数 = {total_rows}")Step2 当总行数 ≥ 1万时,读取已转换为 Parquet 格式的数据文件,通过行列匹配提取目标指标数据,并找出最大值及其对应分类。
import pandas as pd
# 假设已通过大文件处理技能将Excel转换为Parquet
parquet_path = "converted_data.parquet"
df = pd.read_parquet(parquet_path)
# 假设第2行(索引1)是分类表头(如:控股类型、区域等)
header_row = df.iloc[1].tolist()
print("分类表头:", header_row)
# 找到目标指标所在的行(占位示例:'目标指标名称')
target_metric = '目标指标名称'
target_rows = df[df[0] == target_metric]
if not target_rows.empty:
# 提取数值
values = target_rows.iloc[0, 1:].tolist()
# 清洗数据并找出最大值及其对应的分类
numeric_values = []
for val in values:
try:
numeric_values.append(float(val))
except:
numeric_values.append(0)
max_val = max(numeric_values)
max_idx = numeric_values.index(max_val)
max_type = header_row[1:][max_idx]
print(f"\n指标最高的分类: {max_type} ({max_val})")
# 准备写入Excel的数据结构
result_data = list(zip(header_row[1:], numeric_values))Step3 将提取的分析结果保存为新的 Excel 文件,并使用 openpyxl 对最大值所在行进行背景色高亮标注,最后验证输出。
from openpyxl import Workbook
from openpyxl.styles import PatternFill
from openpyxl import load_workbook
output_path = "analysis_result.xlsx"
wb = Workbook()
ws = wb.active
ws.title = "数据分析结果"
# 写入表头
headers = ["分类类型", "指标数值"]
ws.append(headers)
# 写入数据 (使用Step2提取的 result_data,此处为防空值做备用示例)
if 'result_data' not in locals():
result_data = [("分类A", 100), ("分类B", 500), ("分类C", 200)]
max_type = "分类B"
for row in result_data:
ws.append(row)
# 找到最大值所在行并标绿
green_fill = PatternFill(start_color="00FF00", end_color="00FF00", fill_type="solid")
for row in ws.iter_rows(min_row=2, max_row=ws.max_row):
if row[0].value == max_type:
for cell in row:
cell.fill = green_fill
# 保存文件
wb.save(output_path)
print(f"文件已保存到: {output_path}")
# 验证输出文件内容及格式
wb_check = load_workbook(output_path)
ws_check = wb_check.active
print("\n文件内容验证:")
for row in ws_check.iter_rows(values_only=True):
print(row)The SenseNova model family plugs directly into agent runtimes such as OpenClaw and hermes-agent, with the skills in this repository extending the models with concrete, end-to-end office capabilities.
Repo: OpenSenseNova/SenseNova-Skills
Other skills on sensenova-skills.
- /sn-da-excel-workflow
Excel 数据分析多步编排器。覆盖:(1) 读取多 Sheet Excel 文件并统计行数,(2) 大文件检测(≥10k 行自动 Parquet 优化),(3) 数据清洗(缺失值、文本标准化、无效字符),(4) 条件筛选与分类提取,(5) 跨 Sheet 统计聚合,(6) 导出 Excel/CSV 并提供下载链接。覆盖从数据读取到报告生成全流程,按步骤编排 capability 子 skill。**遇到以下任一情况就主动使用本 skill,不要自行写几行 pandas 就回答**:①用户出现触发词:Excel 分析 / 表格分析 / 数据分析 /
Open skill - /duplicate-value-coloring
对比Excel多表中的特定系数并对异常值进行颜色标记。
Open skill - /outlier-coloring
识别 Excel 中的超限数值与错误单元格并进行高亮标注。
Open skill - /threshold-cell-coloring
根据Excel总行数自动切换Parquet加速读取,计算特定维度的时间序列平均值,并使用openpyxl输出带有条件格式(如低于均值标绿)和自定义样式的分析报告。
Open skill - /top-value-coloring
根据数据规模动态选择处理策略,对多表数据进行合并、统计筛选,并利用 openpyxl 实现关键指标的自动化样式高亮与格式化导出。
Open skill - /data-bar-formatting
从带单位的字符串列中提取数值并清洗,生成包含直方图、饼图、条形图和累积分布图的多维度综合分布可视化图表,用于展示数据的集中趋势与分布特征。
Open skill

