Best practices for numerical computing with NumPy including arrays, broadcasting, and vectorization.
Scanned 8/31/2026
Install to Claude Code
npx -y skills add microsoft/debugpy --skill numpy --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Numpy?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/microsoft-numpy)More formats (shields.io, HTML) on the badges page.
---
name: numpy
description: Best practices for numerical computing with NumPy including arrays, broadcasting, and vectorization.
---
# Skill: NumPy
Best practices for numerical computing with NumPy including arrays, broadcasting, and vectorization.
## When to Use
Apply this skill when doing numerical computing with NumPy — arrays, broadcasting, linear algebra, random sampling.
## Arrays
- Use explicit dtypes (`np.float64`, `np.int32`) when creating arrays.
- Prefer `np.zeros`, `np.ones`, `np.empty`, `np.arange`, `np.linspace` over list-based construction.
- Use structured arrays or separate arrays instead of object arrays.
## Vectorization
- Replace Python loops with vectorized NumPy operations wherever possible.
- Use broadcasting rules to operate on arrays of different shapes without explicit expansion.
- Use `np.where()` for conditional element-wise operations.
## Memory
- Use `np.float32` instead of `np.float64` when precision is not critical to halve memory.
- Use views (`reshape`, slicing) instead of copies when data doesn't need mutation.
- Use `np.memmap` for arrays too large to fit in RAM.
## Random
- Use `np.random.default_rng(seed)` (new Generator API) instead of `np.random.seed()`.
- Always seed random generators in tests for reproducibility.
## Pitfalls
- Don't compare floats with `==`; use `np.allclose()` or `np.isclose()`.
- Beware of silent integer overflow in integer arrays.
- Avoid `np.matrix` — it's deprecated; use 2D `np.ndarray`.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!
Playbook for creating and editing uCoz landing pages via MCP tools (`templates_tool`, `ftp_tool`, `modules_tool`). Use for tasks such as: "build a landing page", "update the homepage as a landing page", "create a promo page on the homepage", "add a lead form / menu / SEO to the homepage". Homepage: `page_list`, `page_get`; first publish — `page_update` with full `page_tmpl`; HTML edits after generation — `patch_template` (module_id=2, template_id=1), not `update_template`. Activate the mail f...
Interact with the Paperclip control plane API to manage tasks, coordinate with other agents, and follow company governance. Use when you need to check assignments, update task status, delegate work, post comments, set up or manage routines (recurring scheduled tasks), or call any Paperclip API endpoint. Do NOT use for the actual domain work itself (writing code, research, etc.) — only for Paperclip coordination.
Digital Audio Workstation usage, music composition, interactive music systems, and game audio implementation for immersive soundscapes.
Instantly.ai cold email outreach API - manage campaigns, leads, accounts, and analytics. Use for cold email automation, lead management, campaign creation/monitoring, and email account warmup.
Discover the pull requests this Paperclip instance opened (never community contributions), report what each is for and how confident we are that it is merge-ready, and automatically drive the non-ready ones back to green with /prepare-paperclip-pr — without ever merging.