npx skills add https://github.com/mindrally/skills --skill numpy-best-practices专注于数组编程、数值计算和性能优化的 NumPy 开发专家指南。
weights、gradients、input_array)np.array()、np.zeros()、np.ones()、np.empty()、np.arange()、广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
np.linspace()np.zeros() 或 np.empty() 进行预分配np.concatenate()、np.vstack()、np.hstack() 来组合数组np.where() 进行条件元素选择dtype 参数显式指定合适的数据类型np.float32 进行内存高效计算np.asarray() 进行类型转换,避免不必要的副本np.einsum() 进行复杂的张量运算np.dot() 或 @ 操作符进行矩阵乘法np.ndarray.flags 检查内存布局(C 连续 vs Fortran 连续)out 参数的原位操作np.memmap)axis 参数的 np.sum()、np.mean()、np.std() 进行聚合操作np.cumsum()、np.cumprod() 进行累积操作np.searchsorted() 进行高效的排序数组操作np.isnan()、np.isinf() 妥善处理 NaN 和 Inf 值np.errstate() 上下文管理器来控制浮点错误处理np.random.default_rng() 进行现代随机数生成rng = np.random.default_rng(seed=42)np.random 函数rng.normal()、rng.uniform()、rng.choice()np.linalg 进行线性代数运算np.linalg.solve() 而非计算逆矩阵np.linalg.eig()、np.linalg.svd() 进行矩阵分解np.linalg.cond() 检查矩阵条件数pytest 和 np.testing 断言编写单元测试np.testing.assert_array_equal() 进行精确比较np.testing.assert_array_almost_equal() 进行浮点数比较import numpy as npsnake_case 命名法%timeit 分析代码以识别性能瓶颈每周安装量
121
代码仓库
GitHub 星标数
42
首次出现
2026年1月25日
安全审计
安装于
gemini-cli105
opencode104
codex99
github-copilot96
cursor95
amp88
Expert guidelines for NumPy development, focusing on array programming, numerical computing, and performance optimization.
weights, gradients, input_array)np.array(), np.zeros(), np.ones(), np.empty(), np.arange(), np.linspace()np.zeros() or np.empty() for pre-allocation when array size is knownnp.concatenate(), np.vstack(), np.hstack() for combining arraysnp.where() for conditional element selectiondtype parameternp.float32 for memory-efficient computations when full precision is not needednp.asarray() for type conversion without unnecessary copiesnp.einsum() for complex tensor operationsnp.dot() or @ operator for matrix multiplicationnp.ndarray.flags to check memory layout (C-contiguous vs Fortran-contiguous)out parameter when possiblenp.memmap) for large datasetsnp.sum(), np.mean(), np.std() with axis parameter for aggregationsnp.cumsum(), np.cumprod() for cumulative operationsnp.searchsorted() for efficient sorted array operationsnp.isnan(), np.isinf()np.errstate() context manager for controlling floating-point error handlingnp.random.default_rng() for modern random number generationrng = np.random.default_rng(seed=42)np.random functionsrng.normal(), rng.uniform(), rng.choice()np.linalg for linear algebra operationsnp.linalg.solve() instead of computing inverse for linear systemsnp.linalg.eig(), np.linalg.svd() for decompositionsnp.linalg.cond() before inversionpytest with np.testing assertionsnp.testing.assert_array_equal() for exact comparisonsnp.testing.assert_array_almost_equal() for floating-point comparisonsimport numpy as npsnake_case for variables and functions%timeit to identify bottlenecksWeekly Installs
121
Repository
GitHub Stars
42
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli105
opencode104
codex99
github-copilot96
cursor95
amp88
GSAP React 动画库使用指南:useGSAP Hook 与最佳实践
2,900 周安装