본문으로 건너뛰기
cccskills
무료GitHub에 공개

excel-multi-sheet-threshold-analysis

Extract keyword-matched entries from an Excel sheet, clean whitespace and empty values, and count distinct entries by category. Export separate Excel files containing summary counts and detailed lists for review.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

统计多Sheet Excel总行数并根据规模选择处理策略,提取特定维度信息进行去重统计,并生成摘要与明细报表。

연동 도구Excel
설치 방법 보기

이럴 때 유용합니다

  • Counting distinct facility names by category
  • Extracting entries that match specific keywords
  • Creating summary and detail reports from Excel data

포함된 파일(1)

  • SKILL.md2.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Excel_Multi_Sheet_Deduplication

This sub-skill covers one capability of the Excel workflow. For reading/counting/Parquet optimization, see the parent workflow SKILL.md.

Step1 加载目标数据表,并进行初步的数据预览与结构检查。

import pandas as pd

file_path = 'input_file.xlsx'
target_sheet = 'Sheet1' # 根据实际情况指定 sheet 名称

# 读取数据,header=None 用于处理无表头或非标准表头文件
df = pd.read_excel(file_path, sheet_name=target_sheet, header=None)
print(f"数据形状: {df.shape}")
print("前 5 行预览:")
print(df.head())

Step2 遍历数据行,基于关键词提取目标信息,并执行数据清洗(去除空格、空值过滤)。

import pandas as pd

# 设定目标列索引及过滤关键词
target_col_idx = 1 
keywords = ["关键词A", "关键词B"] # 示例:如"综合楼"、"控制中心"
extracted_data = []

for idx, row in df.iterrows():
    cell_val = str(row[target_col_idx]) if pd.notna(row[target_col_idx]) else ""
    # 数据清洗:去除首尾空格并匹配关键词
    clean_val = cell_val.strip()
    if any(k in clean_val for k in keywords):
        if clean_val and clean_val.lower() not in ["nan", "null", ""]:
            extracted_data.append(clean_val)

print(f"提取到相关记录共 {len(extracted_data)} 条")

Step3 对提取的信息进行分类去重,统计各维度的唯一项数量。

# 使用 set 进行高效去重
category_a_items = set()
category_b_items = set()

for item in extracted_data:
    if "关键词A" in item:
        category_a_items.add(item)
    elif "关键词B" in item:
        category_b_items.add(item)

# 转换为排序后的列表
list_a = sorted(list(category_a_items))
list_b = sorted(list(category_b_items))

print(f"类别A 唯一项数量: {len(list_a)}")
print(f"类别B 唯一项数量: {len(list_b)}")

Step4 将统计摘要与详细清单整理为 DataFrame,并导出为 Excel 文件提供下载。

import pandas as pd

# 1. 生成统计摘要
summary_df = pd.DataFrame({
    '分类名称': ['类别A', '类别B'],
    '唯一项总数': [len(list_a), len(list_b)]
})

# 2. 生成详细清单
detail_list = []
for val in list_a:
    detail_list.append({'分类': '类别A', '详细名称': val})
for val in list_b:
    detail_list.append({'分类': '类别B', '详细名称': val})
detail_df = pd.DataFrame(detail_list)

# 导出结果
output_summary_path = 'summary_report.xlsx'
output_detail_path = 'detail_list.xlsx'

summary_df.to_excel(output_summary_path, index=False)
detail_df.to_excel(output_detail_path, index=False)

print(f"统计摘要已保存: {output_summary_path}")
print(f"详细清单已保存: {output_detail_path}")

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Compare counts and shares for two categories in Excel data. The skill cleans the selected columns, calculates differences and percentages, and produces a summary spreadsheet plus bar and pie charts.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Comparing counts for two categories
  • Visualizing category shares
  • Cleaning merged-cell data before counting
OpenSenseNova/SenseNova-Skills5.8천2026년 10월 9일 업데이트

Analyze Excel data using custom categories, count distributions, and compare groups with charts. Score text using its length, technical terms, numbers, and selected complex concepts, then visualize difficulty levels and the relationship between text length and scores.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Summarize Excel records using custom categories
  • Compare category distributions across groups
  • Score and grade text using adjustable rules
OpenSenseNova/SenseNova-Skills5.8천2026년 10월 9일 업데이트

Count categories in a chosen data column after removing missing values and placeholder labels. Calculate each category’s share and create high-resolution charts combining counts, percentages, pie charts, and horizontal bars for distribution reports.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Compare record counts across categories
  • Show category shares with pie and bar charts
  • Exclude placeholder labels before counting
OpenSenseNova/SenseNova-Skills5.8천2026년 10월 9일 업데이트

Clean category and numeric fields in structured data, compare groups with counts and cross-tabulations, and produce charts, Excel results, and a Markdown report. Export visuals as high-resolution PNG and SVG files for use in reports.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Compare category distributions across groups
  • Clean category labels and fill merged-cell gaps
  • Export analysis results to Excel
OpenSenseNova/SenseNova-Skills5.8천2026년 10월 9일 업데이트

Filter Excel data using candidate column names, RGB color values, text prefixes, and regular expressions, which match text patterns. Calculate totals and averages, then export results to Excel with highlighted rows and a download link.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Filtering rows by RGB values or identifier prefixes
  • Converting text to numbers and calculating totals or averages
  • Extracting matching commands with their identifiers and descriptions
OpenSenseNova/SenseNova-Skills5.8천2026년 10월 9일 업데이트

Filter rows from Excel or previously converted Parquet files, a format designed for efficient data storage. Summarize matching records by group with counts, percentages, and totals, then export the summary to Excel.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Count records containing a specified risk level by work category
  • Calculate group shares among matching records
  • Summarize large datasets already converted to Parquet
OpenSenseNova/SenseNova-Skills5.8천2026년 10월 9일 업데이트

OpenSenseNova의 스킬 모두 보기

이 스킬의 문제 신고