Skip to main content

ncpy

PyPI Version License Downloads Python Versions GitHub Stars Last Commit Open Issues

ncpy Numerical Computing in Python.

ncpy is a compact, educational Python library that implements common numerical methods for quick prototyping and expermentations.
Built on NumPy and (optionally) SciPy, it offers easy-to-use functions for:

  • Root finding
  • Interpolation
  • Curve fitting / Approximation
  • Numerical integration
  • Numerical differentiation
  • Solving linear systems
  • Best Approximations

Why use ncpy?

✅ One package, many methods : no need to import multiple libraries
✅ Lightweight & beginner-friendly : great for teaching & learning numerical methods
✅ Educational : functions are implemented clearly for understanding algorithms
✅ Fast enough : powered by NumPy for efficiency


✨ Features Overview

Category Methods
Root-finding Bisection, Newton–Raphson, Secant, Fixed-point iteration
Interpolation Lagrange, Newton divided differences, Linear, Cubic spline, Neville’s method
Approximation Polynomial least squares, Exponential fit, Logarithmic fit
Integration Trapezoidal, Simpson 1/3, Simpson 3/8, Romberg, Gaussian quadrature
Differentiation Forward, Backward, Central differences, Richardson extrapolation, Numerical gradient
Linear Systems Gaussian elimination, Gauss–Jordan, LU decomposition, Jacobi, Gauss–Seidel, Conjugate Gradient
Best Approximations Least Squares, Gram–Schmidt Orthonormalization

Examples


  • Root finding - Newton Raphson
from ncpy import newton_raphson

f = lambda x: x**2 - 2
df = lambda x: 2*x

root = newton_raphson(f, df, x0=1.0)
print("Root:", root)  # ~1.4142
  • Interpolation — Lagrange
from ncpy import lagrange_interpolation

x_points = [0, 1, 2]
y_points = [1, 3, 2]
print(lagrange_interpolation(x_points, y_points, 1.5))
  • Numerical Integration — Simpson's 1/3 Rule
from ncpy import simpson13
import math

area = simpson13(math.sin, 0, math.pi, n=100)
print(area)  # ~2.0

📦 Installation

pip install ncpy

📍 Visitors

```

Metadata

Release files for ncpy 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ncpy 0.2.4
File Size Uploaded Provenance Actions
ncpy-0.2.4.tar.gz 3.9 kB Without provenance Details for ncpy-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ncpy 0.2.4
File Interpreter ABI Platform Actions
ncpy-0.2.4-py3-none-any.whl Python 3 none any Details for ncpy-0.2.4-py3-none-any.whl

Total release size: 6.7 kB

Release files / ncpy-0.2.4.tar.gz

Download URL ncpy-0.2.4.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bdc357066e09b10b354f7bf20fa800cd0c9dea81624571f659d29f85d33a8f31
BLAKE2b-256 checksum
How to use checksums
790956485fece7d82565bafb5d8fac8ef5205752e0bec1675ac61b94ddf8d1ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.5

Release files / ncpy-0.2.4-py3-none-any.whl

Download URL ncpy-0.2.4-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b66d515f8760b12299a358eb3622acf58486091bb8362ddd1d297386c53dc53f
BLAKE2b-256 checksum
How to use checksums
b0202149c3e68d47ba2579a670388d8ede00cff3c0eeeab07b24ceed78821551
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.5

Security for ncpy 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page