跳到正文
cccskills
免费在 GitHub 公开

numeric-format-normalization

Clean a target Excel column, convert its values to numbers, and compare the calculated total with a summary sheet. Export the totals, match status, and difference in Excel and CSV files.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

对 Excel 数据进行数值格式标准化与清洗,支持大规模数据的 Parquet 转换流程,并完成关键指标的合计核对与结果文件导出。

集成工具Excel
查看安装方法

适用场景

  • Standardize numerical formats before calculating a column total
  • Check detail totals against a summary sheet
  • Export reconciliation results to Excel and CSV

包含的文件(1)

  • SKILL.md2.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Skill Steps

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

Step1 对目标列进行数据清洗(去除空值、标准化数值格式),计算合计值,并与指定汇总 Sheet 中的合计行进行精确核对。

target_col = '目标数值列'  # 示例:'建筑面积'
summary_sheet_name = 'Summary' # 示例汇总Sheet名
summary_item_col = '项目'
summary_value_col = '数值'

# 数据清洗:去除空值、强制转换为数值格式
df_cleaned = df_processed.dropna(subset=[target_col]).copy()
df_cleaned[target_col] = pd.to_numeric(df_cleaned[target_col], errors='coerce')

# 计算合计
total_calculated = df_cleaned[target_col].sum()

# 从指定 Sheet 中读取“合 计”行数值进行核对
try:
    summary_sheet = pd.read_excel(file_path, sheet_name=summary_sheet_name)
    expected_total = summary_sheet.loc[summary_sheet[summary_item_col] == '合 计', summary_value_col].values[0]
    
    # 核对一致性 (处理浮点数精度问题)
    if abs(total_calculated - expected_total) < 1e-6:
        consistency = "一致"
        difference = 0
    else:
        consistency = "不一致"
        difference = abs(total_calculated - expected_total)
    
    print(f"计算合计: {total_calculated}, 指定合计: {expected_total}, 一致性: {consistency}")
except Exception as e:
    print(f"核对失败: {e}")
    expected_total = None
    consistency = "未知"
    difference = None

Step2 将分析与核对结果保存为表格文件,并生成可供下载的文件链接。

output_path_xlsx = 'analysis_result.xlsx'
output_path_csv = 'analysis_result.csv'

# 构建结果表格
result_data = {
    '统计项': ['总行数', f'{target_col}合计(计算值)', f'{target_col}合计(指定值)', '一致性', '差异值'],
    '数值': [total_rows, total_calculated, expected_total, consistency, difference]
}
result_df = pd.DataFrame(result_data)

# 保存为多种格式
result_df.to_excel(output_path_xlsx, index=False)
result_df.to_csv(output_path_csv, index=False, encoding='utf-8-sig')

# 输出下载链接(在报告中展示)
print("分析结果已保存,可下载:")
print(f"- [{output_path_xlsx}](sandbox:/{output_path_xlsx})")
print(f"- [{output_path_csv}](sandbox:/{output_path_csv})")

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 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-Skills57972026年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-Skills57972026年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-Skills57972026年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-Skills57972026年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-Skills57972026年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-Skills57972026年10月9日 更新

查看 OpenSenseNova 的全部技能

报告此技能的问题