Data Science logo

Data Science

Organization
ludo-technologies
data-science

NumPy and pandas best practices for data science and ML code covering vectorization, DataFrame indexing and mutation under Copy-on-Write, dtypes, schema validation with pandera, reproducible randomness, transformation style, array typing, and numeric testing. Use when writing, reviewing, or refactoring code that uses numpy, pandas, DataFrames, ndarrays, Jupyter notebooks, or data pipelines, or when the user asks about pandas/numpy performance or idioms.

Overview

Publisherludo-technologies
Repositorypython-best-practices
Skill namedata-science
Stars
36
Forks
6
Bundled files
16
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 16 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ludo-technologies on GitHub. Read the source before you install it.

Installation

Install the Data Science AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ludo-technologies/python-best-practices/tree/main/skills/data-science
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ludo-technologies/python-best-practices.git /tmp/python-best-practices
mkdir -p .claude/skills
cp -r /tmp/python-best-practices/skills/data-science .claude/skills/data-science
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Data Science in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Data Science on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Data Science is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Python Data Science

NumPy and pandas best practices for data science and ML code. Designed for AI agents and LLMs to write fast, correct, and reproducible numeric code.

Numeric code has idioms that differ from general Python: loops are the anti-pattern, data structures are immutable buffers, and dtypes are a design decision. Where a rule here overlaps a coding-standards rule, this skill takes precedence for array and DataFrame code.

Categories

Vectorization [CRITICAL]

Keep computation in compiled NumPy/pandas code instead of the Python interpreter.

RuleDescription
vec-no-python-loopsVectorize instead of Python loops, iterrows, and row-wise apply (10-1000x faster)
vec-no-incremental-growthBuild arrays and DataFrames once, not incrementally (O(n) vs O(n²))

Indexing & Mutation [CRITICAL]

Write to DataFrames in ways that are correct under Copy-on-Write and visible in the data flow.

RuleDescription
mut-loc-not-chainedAssign with .loc, never with chained indexing
mut-no-inplaceAvoid inplace=True

Data Types [HIGH]

Make dtypes an explicit decision rather than an inference result.

RuleDescription
dtype-explicit-ioSpecify dtypes when loading data
dtype-categoricalUse category dtype for low-cardinality strings
dtype-numpy-explicitChoose NumPy dtypes explicitly

Schema Validation [HIGH]

Validate tabular data where it enters the system.

RuleDescription
schema-panderaValidate DataFrames at boundaries with pandera

Reproducibility [HIGH]

Make experiments repeatable and free of hidden global state.

RuleDescription
repro-default-rngUse an explicit Generator for randomness

Transformation Style [MEDIUM]

Write DataFrame transformations that read top-to-bottom as a single pipeline.

RuleDescription
style-method-chainingExpress transformations as method chains
style-named-aggregationUse named aggregation in groupby

Typing [MEDIUM]

Type hints that carry dtype and column information.

RuleDescription
type-array-annotationsAnnotate arrays and frames with precise types

Testing [MEDIUM]

Assertions that fit floating-point arrays and DataFrames.

RuleDescription
test-numeric-assertionsCompare numeric results with tolerance-aware assertions

Quick Reference

Vectorization

python
# Whole-array operations, not loops / iterrows / apply(axis=1)
df["total"] = df["price"] * df["qty"]
rate = np.select([df["qty"] >= 100, df["qty"] >= 10], [0.2, 0.1], default=0.0)

# Collect, then build once
records = [{"id": item.id, "score": score(item)} for item in items]
results = pd.DataFrame.from_records(records)
combined = pd.concat(frames, ignore_index=True)

Indexing & Mutation

python
# .loc in one step; chained assignment never reaches df under Copy-on-Write
df.loc[df["status"] == "pending", "priority"] = "high"

# Returning form, not inplace=True
df = df.dropna(subset=["email"]).sort_values("created_at")

Data Types

python
df = pd.read_csv(
    path,
    dtype={"customer_id": "Int64", "zip_code": "string", "region": "category"},
    parse_dates=["created_at"],
)
SEVERITY = pd.CategoricalDtype(["low", "medium", "high"], ordered=True)
embeddings = np.zeros((n, 768), dtype=np.float32)

Schema Validation

python
import pandera.pandas as pa
from pandera.typing import DataFrame, Series


class OrderSchema(pa.DataFrameModel):
    order_id: Series[int] = pa.Field(unique=True)
    price: Series[float] = pa.Field(ge=0)

    class Config:
        strict = True


def load_orders(path: str) -> DataFrame[OrderSchema]:
    return OrderSchema.validate(pd.read_csv(path))

Reproducibility

python
def run_experiment(seed: int) -> Result:
    rng = np.random.default_rng(seed)
    split_rng, noise_rng = rng.spawn(2)
    ...

def add_noise(x: np.ndarray, rng: np.random.Generator) -> np.ndarray:
    return x + rng.normal(scale=0.1, size=x.shape)

Transformation Style

python
monthly = (
    pd.read_csv("sales.csv", parse_dates=["date"])
    .assign(
        revenue=lambda d: d["price"] * d["qty"],
        month=lambda d: d["date"].dt.to_period("M"),
    )
    .loc[lambda d: d["revenue"] > 0]
    .groupby("month", as_index=False)
    .agg(total_revenue=("revenue", "sum"), orders=("order_id", "count"))
)

Typing

python
import numpy.typing as npt

def to_float32(values: npt.ArrayLike) -> npt.NDArray[np.float32]:
    return np.asarray(values, dtype=np.float32)

Testing

python
np.testing.assert_allclose(result, expected, rtol=1e-6, atol=1e-12)
pd.testing.assert_frame_equal(result_df, expected_df, check_like=True)

See Also

  • coding-standards - General Python rules; validation-pydantic, design-no-global-singleton, and doc-type-hints have direct counterparts here
  • testing - pytest structure, fixtures, and mocking that numeric tests still follow

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Data Science AI skill do?

NumPy and pandas best practices for data science and ML code covering vectorization, DataFrame indexing and mutation under Copy-on-Write, dtypes, schema validation with pandera, reproducible randomness, transformation style, array typing, and numeric testing. Use when writing, reviewing, or refactoring code that uses numpy, pandas, DataFrames, ndarrays, Jupyter notebooks, or data pipelines, or when the user asks about pandas/numpy performance or idioms.

Why use Data Science on TypingMind?

Because you install it once and use it with any model. Data Science is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Data Science in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ludo-technologies/python-best-practices/tree/main/skills/data-science. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Data Science?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Data Science?

As many as you like. As long as a model supports skills, you can use Data Science with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Data Science AI skill free?

Yes. It is published on GitHub by ludo-technologies under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇