--- id: numexpr version: "2.14.2" license: MIT license_treatment: permissive maintenance: active --- # numexpr — Fast numerical expression evaluator for NumPy License: permissive · Maintenance: active · Downloads: 16.8M/mo ## What it is and what it does NumExpr is a numerical expression evaluator that accelerates array computations by parsing expressions into its own virtual machine bytecode and executing them in chunks that fit in CPU cache. Instead of creating intermediate arrays for each operation (as NumPy does), it processes small chunks of data across all available CPU cores, reducing memory pressure and improving cache locality. This approach typically yields speedups between 0.95x and 4x for common expressions, with larger gains possible for complex mathematical operations. The package works by taking string expressions like `'a*b-4.1*a > 2.5*b'` and evaluating them on NumPy arrays without materializing temporary results. It supports arithmetic, comparison, and transcendental functions (sin, arcsinh, etc.), and can also operate on string arrays. Performance benefits are most pronounced on large arrays; small arrays may see minimal or no improvement. The package optionally integrates with Intel's MKL for further acceleration of transcendental functions on Intel architectures. Use it for: - Accelerate large-scale numerical computations in data analysis pipelines where memory bandwidth is a bottleneck. - Evaluate complex mathematical expressions on multi-gigabyte arrays without exhausting available RAM. - Speed up scientific simulations that repeatedly apply the same expression to different array chunks. - Parallelize array operations across CPU cores for workloads that would otherwise be single-threaded in NumPy. - Reduce memory footprint in memory-constrained environments by avoiding intermediate array allocation. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. NumExpr evaluates numerical expressions on NumPy arrays with multi-threaded acceleration and reduced memory overhead, typically achieving 0.95x to 4x speedups over direct NumPy operations. Yes. NumExpr is actively maintained, has no known vulnerabilities, and offers genuine performance benefits for large-array numerical workloads. The MIT license imposes no restrictions. Install it if you regularly work with large NumPy arrays and need to squeeze performance from complex expressions; skip it for small arrays or simple operations where overhead outweighs gains. ## Install pip install numexpr uv add numexpr poetry add numexpr ## Installing numexpr Before you install: Medium install friction due to compiled wheels for multiple platforms and Python versions. Active maintenance with a recent release (27 days ago) and 2532 repository stars indicate solid ongoing support. License in practice: MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, making it suitable for both open-source and proprietary projects. Quickstart: pip install numexpr import numpy as np import numexpr as ne a = np.arange(1e6) b = np.arange(1e6) result = ne.evaluate("a * b - 4.1 * a > 2.5 * b") Requires NumPy; best performance gains on large arrays that exceed L1 CPU cache size. Verify before relying: - Whether Intel MKL integration (mentioned in docs) is available in standard pip wheels or requires separate configuration. - Actual performance gains on your specific hardware and expression complexity (documentation notes 0.95x to 4x range but results vary). - Free-threading support status on CPython 3.13+ and any threading interaction caveats beyond what the description states. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 16.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags fast numpy array expressions, numerical expression evaluator, numpy array computation speedup, parallel array operations, memory-efficient array math, numpy expression optimization, multi-threaded array evaluation, performance-optimization, numerical-computing [View on SkillFed](https://skillfed.io/packages/numexpr) · [View on PyPI](https://pypi.org/project/numexpr/)