data-cleaning-standards
БесплатноБез исполняемых скриптовНе проверенClean and standardize vehicle insurance CSV/Excel data. Use when handling missing values, fixing data formats, removing duplicates, or standardizing fields…
от FDU-INS★ 84 звезды на GitHubОб этом скилле
Data Cleaning Standards
Clean and standardize vehicle insurance data following established business rules.
When to Activate
Use this skill when the user:
- Says "clean the data" or "standardize data"
- Mentions "missing values", "null handling", or "fill missing"
- Asks "remove duplicates" or "deduplicate"
- Wants to "normalize dates" or "standardize formats"
- Mentions data preparation or preprocessing
Quick Start Workflow
Step 1: Handle Missing Values
↓
Step 2: Remove Duplicates
↓
Step 3: Standardize Formats
↓
Step 4: Handle Outliers
Step 1: Handle Missing Values
1.1 Missing Value Strategy by Field Type
| Field Type | Strategy | Fill Value | Why |
|---|---|---|---|
| 三级机构 | Lookup from mapping | From mapping table | Authoritative source |
| 团队简称 | Keep null | '' (empty string) |
Optional field |
| 签单/批改保费 | Delete row | N/A | Critical metric |
| 手续费含税 | Fill zero | 0 |
Legitimate zero commission |
| 是否续保 | Keep null | '' |
Display as "Unknown" |
| String fields | Fill empty | '' |
Avoid None errors |
| Numeric fields | Delete or 0 | Depends on field | Case by case |
1.2 Implementation
def handle_missing_values(df, staff_mapping):
"""Apply missing value strategy"""
# 1. 三级机构 - lookup from mapping
if '三级机构' in df.columns:
for idx in df[df['三级机构'].isnull()].index:
staff = df.at[idx, '业务员']
mapped_info = lookup_staff_info(staff, staff_mapping)
if mapped_info:
df.at[idx, '三级机构'] = mapped_info['三级机构']
# 2. 手续费 - fill zero
if '手续费含税' in df.columns:
df['手续费含税'] = df['手续费含税'].fillna(0)
# 3. 签单保费 - delete missing rows
before = len(df)
df = df[df['签单/批改保费'].notnull()]
after = len(df)
if before > after:
print(f"Deleted {before - after} rows with missing premium")
# 4. String fields - fill empty
string_cols = df.select_dtypes(include=['object']).columns
df[string_cols] = df[string_cols].fillna('')
return df
Step 2: Remove Duplicates
2.1 Deduplication Rules
Composite Key: 保单号 + 投保确认时间
Keep Strategy: keep='last' (most recent record)
Why: Same policy may have multiple updates (批改)
2.2 Implementation
def remove_duplicates(df):
"""Remove duplicate records"""
# Ensure date is datetime
df['投保确认时间'] = pd.to_datetime(df['投保确认时间'], errors='coerce')
# Use duplicated() to avoid type issues
before = len(df)
dup_mask = df.duplicated(subset=['保单号', '投保确认时间'], keep='last')
df = df[~dup_mask]
after = len(df)
if before > after:
print(f"Removed {before - after} duplicates")
return df
Step 3: Standardize Formats
3.1 Date Standardization
Target Format: datetime64[ns]
def standardize_dates(df):
"""Convert all date fields to datetime"""
date_cols = ['刷新时间', '投保确认时间', '保险起期']
for col in date_cols:
if col in df.columns:
df[col] = pd.to_datetime(df[col], errors='coerce')
invalid = df[col].isnull().sum()
if invalid > 0:
print(f"⚠️ {col}: {invalid} invalid dates converted to NaT")
return df
3.2 Numeric Standardization
Target Format: float64
def standardize_numerics(df):
"""Convert numeric fields to float"""
numeric_cols = ['签单/批改保费', '签单数量', '手续费', '手续费含税', '增值税']
for col in numeric_cols:
if col in df.columns:
df[col] = pd.to_numeric(df[col], errors='coerce')
return df
3.3 String Standardization
Rules:
- Strip leading/trailing whitespace
- Map variations (Y/N → 是/否)
def standardize_strings(df):
"""Clean string fields"""
# Strip whitespace
string_cols = df.select_dtypes(include=['object']).columns
for col in string_cols:
df[col] = df[col].astype(str).str.strip()
# Standardize yes/no fields
yes_no_cols = ['是否续保', '是否新能源', '是否过户车', '是否异地车']
for col in yes_no_cols:
if col in df.columns:
df[col] = df[col].map({
'Y': '是', 'N': '否',
'y': '是', 'n': '否',
'1': '是', '0': '否'
}).fillna(df[col])
return df
Step 4: Handle Outliers
4.1 Outlier Detection Rules
Important: NEVER delete negative premiums (legitimate business data)
| Outlier Type | Detection Rule | Action |
|---|---|---|
| Negative premium | < 0 |
✅ KEEP (refunds/adjustments) |
| Extreme premium | < -1M or > 100K |
⚠️ Flag only |
| Zero commission | == 0 |
✅ KEEP (normal) |
| Negative amount | 保额 < 0 |
⚠️ Flag only |
4.2 Implementation
def detect_outliers(df):
"""Detect outliers but DO NOT delete"""
outliers = {}
# 1. Extreme premium (flag only)
if '签单/批改保费' in df.columns:
extreme = df[
(df['签单/批改保费'] < -1000000) |
(d
Установить data-cleaning-standards в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadEditGrepGlobFAQ
Что делает скилл data-cleaning-standards?
Clean and standardize vehicle insurance CSV/Excel data. Use when handling missing values, fixing data formats, removing duplicates, or standardizing fields. Mentions "clean data", "handle nulls", "standardize", "duplicates", or "normalize".
Как установить скилл data-cleaning-standards?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл data-cleaning-standards запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic