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.
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
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.