NumPy for scientific Python: dtypes and casting, creation, reshaping, broadcasting, indexing vs views, ufuncs and reductions, linear algebra and einsum, random Generator, I/O, structured arrays, performance and pandas boundaries. Use when writing or reviewing ndarray code. Triggers on numpy, ndarray, broadcasting, dtype, ufunc, einsum, vectorization.
Instalación
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
NumPy for scientific Python: dtypes and casting, creation, reshaping, broadcasting, indexing vs views, ufuncs and reductions, linear algebra and einsum, random Generator, I/O, structured arrays, performance and pandas boundaries. Use when writing or reviewing ndarray code. Triggers on numpy, ndarray, broadcasting, dtype, ufunc, einsum, vectorization.
NumPy (scientific computing)
Quick start
Shape and dtype first: decide shape, dtype, and memory order (C vs F) before filling arrays; avoid silent astype widening. See reference-arrays-dtypes.md.
Know view vs copy: basic slicing is usually a view; fancy indexing is a copy; reshape may view or copy. Mutations alias bugs are common. See reference-indexing-views.md.
Broadcasting: align trailing dimensions; use None / newaxis and np.broadcast_to deliberately. See reference-broadcasting-shape.md.
Reductions: always pass axis and use keepdims=True when broadcasting the result back; prefer np.nanmean etc. when NaNs appear. Mind float summation order for reproducibility. See reference-ufuncs-reductions.md.
Random: use np.random.Generator (PCG64), not legacy global RandomState, for reproducible science. See reference-random-io-structured.md.