python零依赖数学库
Project description
nbmath
一个实用的数学工具包,支持方程求解、几何计算、统计分析等功能。
安装
pip install https://ghproxy.net/https://github.com/tc0512/nbmath/releases/download/v0.1.6/nbmath-0.1.6-py3-none-any.whl
快速开始
from nbmath.equation import solve
from nbmath.const import pi
#解方程
print(solve(1, -3, 2)) #[(2+0j), (1+0j)]
#调用常数
print(pi()) #3.141592653589793
模块介绍
常数模块nbmath.const
pitaue- 数学常数GgkNA- 物理常数
方程模块nbmath.solve
- 一元一次/二次/三次/四次方程求解
- 牛顿迭代法解高次方程
- 统一接口
solve
几何模块nbmath.geometry
- 点
Point - 线段
Line - 圆
Circle - 多边形
Polygon
统计模块nbmath.stats
mean平均数percentile百分位数mode众数var方差std标准差
工具模块nbmath.utils
gcd最大公约数lcm最小公倍数floor向下取整trunc截断取整fac阶乘diff多项式求导np.linspace纯python实现polyval多项式代入求值timer计时器
示例代码
from nbmath.equation import solve
from nbmath.stats import mode
#求解x^4-10x^2+9=0
roots = solve(1, 0, -10, 0, 9)
print(roots) #接近±1,±3,浮点误差可能存在,请以实际使用为准
data = [1, 1, 2, 3, 4]
print(mode(data)) #[1]
许可证
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nbmath-0.1.7.tar.gz
(8.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nbmath-0.1.7.tar.gz.
File metadata
- Download URL: nbmath-0.1.7.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e04f58dac4d7b2f8b94b1f6cc655c2fe7ecee72490032cf93c1669abfd4852f0
|
|
| MD5 |
6b080a1a269f7e16a23ee41282fc4f5d
|
|
| BLAKE2b-256 |
de09aa76f1b1010f86f5cea8920a1e9907bbeb95fb82676f29070141fb93b0ab
|
File details
Details for the file nbmath-0.1.7-py3-none-any.whl.
File metadata
- Download URL: nbmath-0.1.7-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db38f989a94fc8e7904f428256db85949a9086093766763a0ab7bcf63d5c665f
|
|
| MD5 |
3a967df8736833388c2280bb1269ce70
|
|
| BLAKE2b-256 |
e1a2bf5731f4b50ea0d4704a699f5266aa57cbfa478d8569ec691e492def1436
|