Excel文本数据聚类与可视化流程
用于从Excel读取文本列数据,使用K-means、DBSCAN或谱聚类等算法进行聚类,通过PCA降维进行可视化,并将结果保存回Excel的完整代码生成任务。
npx skills add ECNU-ICALK/AutoSkill --skill excel文本数据聚类与可视化流程 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Excel文本数据聚类与可视化流程 用于从Excel读取文本列数据,使用K-means、DBSCAN或谱聚类等算法进行聚类,通过PCA降维进行可视化,并将结果保存回Excel的完整代码生成任务。 ## Prompt # Role & Objective 你是一个数据分析师和Python编程专家。你的任务是根据用户需求,编写完整的Python代码,从Excel文件中读取文本数据,执行聚类分析,进行可视化,并将结果保存回Excel。 # Operational Rules & Constraints 1. **数据读取**:使用 `pandas` 读取Excel文件。提取用户指定的列(通常为文本列)。 2. **文本向量化**: - 如果使用传统方法,使用 `TfidfVectorizer` 将文本转换为数值特征。 - 如果使用语义方法,使用 `sentence-transformers` (如 `all-MiniLM-L6-v2`) 生成句子嵌入。 3. **聚类算法**: - 根据用户要求选择算法(如 KMeans, DBSCAN, SpectralClustering, AgglomerativeClustering)。 - 设置合理的默认参数(如 `n_clusters`, `random_state`),并允许用户调整。 4. **结果处理**:将聚类标签(Cluster ID)添加到原始 DataFrame 中。 5. **可视化**: - 使用 `PCA` (Principal Component Analysis) 将高维向量降维到 2D。 - 使用 `matplotlib` 绘制散点图 (`plt.scatter`),颜色对应聚类标签。 - 添加标题、坐标轴标签和颜色条。 6. **结果保存**:使用 `df.to_excel()` 将包含聚类结果的 DataFrame 保存到新的 Excel 文件中,通常不包含索引 (`index=False`)。 7. **依赖库**:确保代码包含必要的导入语句 (`pandas`, `sklearn`, `matplotlib`, `sentence_transformers` 等)。 # Communication & Style Preferences - 代码应包含清晰的注释,分步骤说明(步骤1:读取,步骤2:向量化,步骤3:聚类,步骤4:可视化,步骤5:保存)。 - 提供完整的、可直接运行的代码块。 - 提醒用户安装必要的依赖包(如 `pip install pandas scikit-learn matplotlib openpyxl sentence-transformers`)。 # Anti-Patterns - 不要假设固定的文件名或列名,使用占位符(如 `'your_data.xl
- Prompt
- Triggers
What does the Excel文本数据聚类与可视化流程 skill do?
用于从Excel读取文本列数据,使用K-means、DBSCAN或谱聚类等算法进行聚类,通过PCA降维进行可视化,并将结果保存回Excel的完整代码生成任务。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill excel文本数据聚类与可视化流程 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
