对Excel文件进行文本标准化清洗(如去除异常前缀、提取纯中文字符等),并,最终输出清洗后的Excel文件并提供下载链接。
npx skills add https://github.com/OpenSenseNova/SenseNova-Skills --skill text-normalization-and-large-file-processing
> This sub-skill covers one capability of the Excel workflow. For reading/counting/Parquet optimization, see the parent workflow SKILL.md.
Step1 识别并清洗包含前缀符号的异常数值字段,统一转换为整数类型;同时使用正则表达式清洗文本字段,仅保留 Unicode 范围内的中文字符。
import re
import numpy as np
target_numeric_col = '需要转数字的文本列' # 示例:'获赞'
target_text_col = '需要提取中文的列' # 示例:'收货人'
# 1. 清洗包含前缀符号的数值字段
prefix_patterns = ['.', 'I ', '■ ', '一 ', '_', '. ']
def clean_numeric_with_prefix(value):
val_str = str(value).strip()
if val_str in ['None', 'nan', '', 'nan']:
return np.nan
for prefix in prefix_patterns:
if val_str.startswith(prefix):
val_str = val_str[len(prefix):].strip()
break
if val_str == '':
return np.nan
try:
return int(val_str)
except ValueError:
return np.nan
# 2. 清洗文本字段,仅保留 Unicode 范围内的中文字符(\u4e00-\u9fff)
def clean_chinese_name(name):
if pd.isna(name):
return name
s = str(name)
chinese_chars = re.findall(r'[\u4e00-\u9fff]', s)
cleaned = ''.join(chinese_chars)
return cleaned if cleaned else ''
if target_numeric_col in df.columns:
df[f'{target_numeric_col}_清洗后'] = df[target_numeric_col].apply(clean_numeric_with_prefix)
if target_text_col in df.columns:
df[f'{target_text_col}_清洗后'] = df[target_text_col].apply(clean_chinese_name)
Step2 将清洗后的结果保存为 Excel 文件,在报告中提供下载链接,并执行内存清理以应对大文件处理时的内存压力。
output_path = '/mnt/data/标准化清洗结果.xlsx'
# 保存清洗结果
df.to_excel(output_path, index=False, engine='openpyxl')
print(f'清洗结果已保存到: {output_path}')
# 生成可下载链接
print(f'[下载清洗结果表](sandbox:{output_path})')
# 内存清理
if 'df' in locals():
del df
gc.collect()
Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
Build and distribute Expo development clients locally or via TestFlight
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Take opensensenova/text-normalization-and-large-file-processing from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.