
import pandas as pd

file_path = r'/root/.openclaw/workspace-xiaoyan/business_knowledge/L2单词表/情境分类.xlsx'
df = pd.read_excel(file_path)

col_d = df.columns[3]
col_word = df.columns[0]

# 按分类分组，显示每个分类的单词样例
categories = df.groupby(col_d)
for cat, group in categories:
    words = group[col_word].dropna().tolist()
    print(f"\n{'='*60}")
    print(f"【{cat}】({len(words)}个单词)")
    print(f"样例: {', '.join(str(w) for w in words[:15])}")
    if len(words) > 15:
        print(f"  ... 共{len(words)}个")
