Agent Skillslangchain-ai/deepagents › cudf-analytics

cudf-analytics

GitHub

用于利用 NVIDIA cuDF 进行 GPU 加速的大规模表格数据分析,支持 CSV 读取、统计摘要、分组聚合、异常检测及数据轮廓分析。

examples/nvidia_deep_agent/skills/cudf-analytics/SKILL.md langchain-ai/deepagents

Trigger Scenarios

GPU 加速的表格数据分析 大规模数据集统计摘要计算 分组聚合操作 数据异常检测 百万级行数据轮廓分析

Install

npx skills add langchain-ai/deepagents --skill cudf-analytics -g -y
More Options

Non-standard path

npx skills add https://github.com/langchain-ai/deepagents/tree/main/examples/nvidia_deep_agent/skills/cudf-analytics -g -y

Use without installing

npx skills use langchain-ai/deepagents@cudf-analytics

指定 Agent (Claude Code)

npx skills add langchain-ai/deepagents --skill cudf-analytics -a claude-code -g -y

安装 repo 全部 skill

npx skills add langchain-ai/deepagents --all -g -y

预览 repo 内 skill

npx skills add langchain-ai/deepagents --list

SKILL.md

Frontmatter
{
    "name": "cudf-analytics",
    "description": "Use for GPU-accelerated data analysis on datasets, CSVs, or tabular data using NVIDIA cuDF. Triggers when tasks involve groupby aggregations, statistical summaries, anomaly detection, or large-scale data profiling."
}

cuDF Analytics Skill

GPU-accelerated data analysis using NVIDIA RAPIDS cuDF. cuDF provides a pandas-like API that runs on NVIDIA GPUs, enabling massive speedups on large datasets.

When to Use This Skill

Use this skill when:

  • Analyzing CSV files, datasets, or tabular data
  • Computing statistical summaries (mean, median, std, quartiles)
  • Performing groupby aggregations
  • Detecting anomalies or outliers in data
  • Profiling datasets with millions of rows
  • Computing correlation matrices

Initialization (REQUIRED)

Always start every script with this boilerplate. It tests actual GPU operations, not just import.

import pandas as pd

try:
    import cudf
    # Smoke-test: verify GPU compute AND host transfer both work
    _test = cudf.Series([1, 2, 3])
    assert _test.sum() == 6
    assert _test.to_pandas().tolist() == [1, 2, 3]
    GPU = True
except Exception as e:
    print(f"[GPU] cudf unavailable, falling back to pandas: {e}")
    GPU = False

def read_csv(path):
    return cudf.read_csv(path) if GPU else pd.read_csv(path)

def to_pd(df):
    """Convert cuDF DataFrame/Series to pandas. Use this instead of .to_pandas() directly."""
    if not GPU:
        return df
    try:
        return df.to_pandas()
    except Exception as e:
        print(f"[GPU] .to_pandas() failed, using Arrow fallback: {e}")
        return df.to_arrow().to_pandas()

Quick Reference

cuDF mirrors the pandas API. Common operations:

Read Data

df = read_csv("data.csv")

Statistical Summary

# Use to_pd() when you need pandas output
summary = to_pd(df[["value", "score"]].describe())

# Scalar values work directly with float()
mean_val = float(df["value"].mean())
q1 = float(df["value"].quantile(0.25))

# Correlation
corr = float(df["value"].corr(df["score"]))

Groupby Aggregation

result = df.groupby("category").agg({
    "revenue": ["sum", "mean", "count"],
    "quantity": ["sum", "mean"],
})
result_pd = to_pd(result)

Anomaly Detection (IQR Method)

col = "value"
Q1 = float(df[col].quantile(0.25))
Q3 = float(df[col].quantile(0.75))
IQR = Q3 - Q1
lower = Q1 - 1.5 * IQR
upper = Q3 + 1.5 * IQR
outliers = to_pd(df[(df[col] < lower) | (df[col] > upper)])

Anomaly Detection (Z-Score Method)

mean = float(df[col].mean())
std = float(df[col].std())
df["z_score"] = (df[col] - mean) / std
anomalies = to_pd(df[df["z_score"].abs() > 3])

Filtering and Selection

# Filter rows
filtered = df[df["status"] == "active"]

# Select columns
subset = df[["name", "revenue", "date"]]

# Sort
sorted_df = df.sort_values("revenue", ascending=False)

# Convert to pandas for final output / iteration
result_pd = to_pd(sorted_df)

Data Type Requirements

cuDF requires explicit type specification for optimal performance:

  • Use float32 or float64 for numeric data
  • Use int32 or int64 for integer data
  • String columns use cuDF's string dtype automatically

Output Guidelines

When reporting analysis results:

  • Include dataset dimensions (rows x columns)
  • Show key statistics in formatted tables
  • Highlight notable patterns, trends, or anomalies
  • Provide both summary statistics and specific examples
  • Note any data quality issues (missing values, outliers)

Version History

  • 1e4f507 Current 2026-08-20 16:32

Same Skill Collection

.agents/skills/textual-screenshot/SKILL.md
examples/content-builder-agent/skills/blog-post/SKILL.md
examples/content-builder-agent/skills/social-media/SKILL.md
examples/deploy-coding-agent/skills/code-review/SKILL.md
examples/deploy-coding-agent/skills/coding-prefs/SKILL.md
examples/deploy-coding-agent/skills/planning/SKILL.md
examples/deploy-content-writer/skills/blog-post/SKILL.md
examples/deploy-content-writer/skills/social-media/SKILL.md
examples/deploy-gtm-agent/skills/competitor-analysis/SKILL.md
examples/nvidia_deep_agent/skills/cuml-machine-learning/SKILL.md
examples/nvidia_deep_agent/skills/data-visualization/SKILL.md
examples/nvidia_deep_agent/skills/gpu-document-processing/SKILL.md
examples/text-to-sql-agent/skills/query-writing/SKILL.md
examples/text-to-sql-agent/skills/schema-exploration/SKILL.md
libs/cli/examples/skills/arxiv-search/SKILL.md
libs/cli/examples/skills/langgraph-docs/SKILL.md
libs/cli/examples/skills/web-research/SKILL.md
libs/code/deepagents_code/built_in_skills/deepagents-thread-inspector/SKILL.md
libs/code/deepagents_code/built_in_skills/remember/SKILL.md
libs/code/examples/skills/arxiv-search/SKILL.md
libs/code/examples/skills/langgraph-docs/SKILL.md
libs/code/examples/skills/web-research/SKILL.md
libs/cli/examples/skills/skill-creator/SKILL.md
libs/code/deepagents_code/built_in_skills/skill-creator/SKILL.md
libs/code/examples/skills/skill-creator/SKILL.md

Metadata

Files
0
Version
28e5218
Hash
c8a677b6
Indexed
2026-08-20 16:32

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-29 21:48
浙ICP备14020137号-1 $Гость$