PyPyNum 1.13.0__py3-none-any.whl → 1.14.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PyPyNum-1.13.0.dist-info → PyPyNum-1.14.0.dist-info}/METADATA +152 -196
- {PyPyNum-1.13.0.dist-info → PyPyNum-1.14.0.dist-info}/RECORD +20 -17
- pypynum/Array.py +70 -15
- pypynum/Matrix.py +3 -3
- pypynum/README.md +151 -195
- pypynum/__init__.py +5 -2
- pypynum/bessel.py +173 -0
- pypynum/crandom.py +101 -0
- pypynum/dataproc.py +216 -0
- pypynum/errors.py +4 -0
- pypynum/interp.py +1 -1
- pypynum/maths.py +53 -46
- pypynum/multiprec.py +38 -4
- pypynum/numbers.py +67 -0
- pypynum/test.py +0 -11
- pypynum/tools.py +33 -0
- pypynum/ufuncs.py +39 -0
- pypynum/zh_cn.py +32 -3
- {PyPyNum-1.13.0.dist-info → PyPyNum-1.14.0.dist-info}/WHEEL +0 -0
- {PyPyNum-1.13.0.dist-info → PyPyNum-1.14.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyPyNum
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.14.0
|
|
4
4
|
Summary: PyPyNum is a Python library for math & science computations, covering algebra, calculus, stats, with data structures like matrices, vectors, tensors. It offers numerical tools, programs, and supports computational ops, functions, processing, simulation, & visualization in data science & ML, crucial for research, engineering, & data processing.
|
|
5
5
|
Home-page: https://github.com/PythonSJL/PyPyNum
|
|
6
6
|
Author: Shen Jiayi
|
|
@@ -234,76 +234,68 @@ processing.</font><font color = red>[Python>=3.4]</font>
|
|
|
234
234
|
[](https://pepy.tech/project/pypynum)
|
|
235
235
|
[](https://pepy.tech/project/pypynum)
|
|
236
236
|
|
|
237
|
-
## Version -> 1.
|
|
237
|
+
## Version -> 1.14.0 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
|
|
238
238
|
|
|
239
239
|

|
|
240
240
|
|
|
241
|
-
PyPI上无法显示logo,可以在Gitee或者GitHub中查看。
|
|
242
|
-
|
|
243
241
|
The logo cannot be displayed on PyPI, it can be viewed in Gitee or GitHub.
|
|
244
242
|
|
|
245
|
-
###
|
|
246
|
-
|
|
247
|
-
#### Introduction
|
|
243
|
+
### Introduction
|
|
248
244
|
|
|
249
|
-
+ 多功能数学库,类似于numpy、scipy等,专为PyPy解释器制作,亦支持其他类型的Python解释器
|
|
250
245
|
+ Multi functional math library, similar to numpy, scipy, etc., designed specifically for PyPy interpreters and also
|
|
251
246
|
supports other types of Python interpreters
|
|
252
|
-
+ 不定期更新版本,增加更多实用功能
|
|
253
247
|
+ Update versions periodically to add more practical features
|
|
254
|
-
+ 如需联系,请添加QQ号2261748025(Py𝙿𝚢𝚝𝚑𝚘𝚗-水晶兰),或者通过我的邮箱2261748025@qq.com
|
|
255
248
|
+ If you need to contact, please add QQ number 2261748025 (Py𝙿𝚢𝚝𝚑𝚘𝚗-水晶兰), or through my email 2261748025@qq.com
|
|
256
249
|
|
|
257
|
-
###
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
|
262
|
-
|
|
263
|
-
| `pypynum.
|
|
264
|
-
| `pypynum.
|
|
265
|
-
| `pypynum.
|
|
266
|
-
|
|
|
267
|
-
|
|
|
268
|
-
|
|
|
269
|
-
|
|
|
270
|
-
|
|
|
271
|
-
|
|
|
272
|
-
|
|
|
273
|
-
| `pypynum.
|
|
274
|
-
|
|
|
275
|
-
| `pypynum.
|
|
276
|
-
| `pypynum.
|
|
277
|
-
| `pypynum.
|
|
278
|
-
| `pypynum.
|
|
279
|
-
| `pypynum.
|
|
280
|
-
| `pypynum.
|
|
281
|
-
|
|
|
282
|
-
|
|
|
283
|
-
| `pypynum.
|
|
284
|
-
| `pypynum.
|
|
285
|
-
|
|
|
286
|
-
| `pypynum.
|
|
287
|
-
| `pypynum.
|
|
288
|
-
|
|
|
289
|
-
|
|
|
290
|
-
|
|
|
291
|
-
| `pypynum.
|
|
292
|
-
|
|
|
293
|
-
|
|
|
294
|
-
|
|
|
295
|
-
| `pypynum.
|
|
296
|
-
|
|
|
297
|
-
|
|
|
298
|
-
|
|
|
299
|
-
| `pypynum.
|
|
300
|
-
| `pypynum.
|
|
301
|
-
| `pypynum.
|
|
302
|
-
| `pypynum.
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
#### The Zen of PyPyNum (Preview)
|
|
250
|
+
### Name and Function Introduction of Submodules
|
|
251
|
+
|
|
252
|
+
| Submodule Name | Function Introduction |
|
|
253
|
+
|:--------------------:|:-----------------------------------:|
|
|
254
|
+
| `pypynum.Array` | Multidimensional array |
|
|
255
|
+
| `pypynum.bessel` | Bessel functions |
|
|
256
|
+
| `pypynum.chars` | Special mathematical symbols |
|
|
257
|
+
| `pypynum.cipher` | Encryption and decryption algorithm |
|
|
258
|
+
| `pypynum.confs` | Universal configuration |
|
|
259
|
+
| `pypynum.constants` | Set of mathematical constants |
|
|
260
|
+
| `pypynum.crandom` | Random complex number |
|
|
261
|
+
| `pypynum.dataproc` | Data processing |
|
|
262
|
+
| `pypynum.dists` | Probability distribution |
|
|
263
|
+
| `pypynum.equations` | Solving equations |
|
|
264
|
+
| `pypynum.errors` | Exception object |
|
|
265
|
+
| `pypynum.file` | File read and write |
|
|
266
|
+
| `pypynum.FourierT` | Fourier transform |
|
|
267
|
+
| `pypynum.Geometry` | Geometric shape |
|
|
268
|
+
| `pypynum.Graph` | Graph Theory Algorithm |
|
|
269
|
+
| `pypynum.Group` | Group Theory Algorithm |
|
|
270
|
+
| `pypynum.image` | Image processing |
|
|
271
|
+
| `pypynum.interp` | Data Interpolation |
|
|
272
|
+
| `pypynum.Logic` | Logic circuit design |
|
|
273
|
+
| `pypynum.maths` | General mathematical functions |
|
|
274
|
+
| `pypynum.Matrix` | Matrix operation |
|
|
275
|
+
| `pypynum.multiprec` | Multi precision calculation |
|
|
276
|
+
| `pypynum.NeuralN` | Neural network training |
|
|
277
|
+
| `pypynum.numbers` | Number processing |
|
|
278
|
+
| `pypynum.plotting` | Data visualization |
|
|
279
|
+
| `pypynum.polynomial` | Polynomial operation |
|
|
280
|
+
| `pypynum.pprinters` | Pretty printers |
|
|
281
|
+
| `pypynum.Quaternion` | Quaternion operation |
|
|
282
|
+
| `pypynum.random` | Random number generation |
|
|
283
|
+
| `pypynum.regression` | Regression analysis |
|
|
284
|
+
| `pypynum.sequence` | Sequence calculation |
|
|
285
|
+
| `pypynum.stattest` | Statistical test |
|
|
286
|
+
| `pypynum.Symbolics` | Symbol calculation |
|
|
287
|
+
| `pypynum.Tensor` | Tensor operation |
|
|
288
|
+
| `pypynum.test` | Easy test |
|
|
289
|
+
| `pypynum.this` | Zen of Projects |
|
|
290
|
+
| `pypynum.tools` | Auxiliary functions |
|
|
291
|
+
| `pypynum.Tree` | Tree data structure |
|
|
292
|
+
| `pypynum.types` | Special types |
|
|
293
|
+
| `pypynum.ufuncs` | Universal functions |
|
|
294
|
+
| `pypynum.utils` | Utility |
|
|
295
|
+
| `pypynum.Vector` | Vector operation |
|
|
296
|
+
| `pypynum.zh_cn` | Functions with Chinese names |
|
|
297
|
+
|
|
298
|
+
### The Zen of PyPyNum (Preview)
|
|
307
299
|
|
|
308
300
|
```
|
|
309
301
|
The Zen of PyPyNum, by Shen Jiayi
|
|
@@ -332,118 +324,57 @@ Python interpreter and run it!
|
|
|
332
324
|
February 27, 2024
|
|
333
325
|
```
|
|
334
326
|
|
|
335
|
-
###
|
|
336
|
-
|
|
337
|
-
#### Functional changes compared to the previous version
|
|
327
|
+
### Functional changes compared to the previous version
|
|
338
328
|
|
|
339
329
|
```
|
|
340
330
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
341
331
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
The multiprec module has added some new functions
|
|
345
|
-
|
|
346
|
-
asmpc(real: Union[int, float, str, decimal.Decimal, complex, pypynum.multiprec.MPComplex], imag: Union[int, float, str, decimal.Decimal] = 0, sigfigs: int = 28) -> pypynum.multiprec.MPComplex
|
|
347
|
-
mp_acos(x: Union[int, float, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
348
|
-
mp_asin(x: Union[int, float, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
349
|
-
mp_fresnel_c(x: Union[int, float, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
350
|
-
mp_fresnel_s(x: Union[int, float, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
新增了MPComplex类,
|
|
354
|
-
其实现了多精度复数计算,
|
|
355
|
-
目前支持加、减、乘、除、指数、对数等运算,
|
|
356
|
-
并且将在后面的版本增加各种三角函数。
|
|
332
|
+
750 new lines have been added to the code
|
|
357
333
|
|
|
358
|
-
|
|
359
|
-
which implements multi precision complex calculations.
|
|
360
|
-
Currently,
|
|
361
|
-
it supports operations such as addition,
|
|
362
|
-
subtraction,
|
|
363
|
-
multiplication,
|
|
364
|
-
division,
|
|
365
|
-
exponentiation,
|
|
366
|
-
and logarithm,
|
|
367
|
-
and various trigonometric functions will be added in later versions.
|
|
368
|
-
|
|
369
|
-
MPComplex(real, imag, sigfigs=28)
|
|
334
|
+
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
370
335
|
|
|
336
|
+
Newly added functions and classes
|
|
371
337
|
|
|
372
|
-
创建多精度复数时建议使用asmpc函数,
|
|
373
|
-
因为它可以更方便地把其他数值类型转换为MPComplex对象。
|
|
374
338
|
|
|
375
|
-
|
|
376
|
-
|
|
339
|
+
├── bessel
|
|
340
|
+
│ ├── CLASS
|
|
341
|
+
│ └── FUNCTION
|
|
342
|
+
│ ├── bessel_i0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
343
|
+
│ ├── bessel_i1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
344
|
+
│ ├── bessel_iv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
345
|
+
│ ├── bessel_j0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
346
|
+
│ ├── bessel_j1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
347
|
+
│ └── bessel_jv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
348
|
+
├── crandom
|
|
349
|
+
│ └── FUNCTION
|
|
350
|
+
│ ├── randint_polar(left: int, right: int, mod: typing.Union[int, float], angle: typing.Union[int, float]) -> complex
|
|
351
|
+
│ ├── randint_rect(left: int, right: int, real: typing.Union[int, float], imag: typing.Union[int, float]) -> complex
|
|
352
|
+
│ ├── random_polar(mod: typing.Union[int, float], angle: typing.Union[int, float]) -> complex
|
|
353
|
+
│ ├── random_rect(real: typing.Union[int, float], imag: typing.Union[int, float]) -> complex
|
|
354
|
+
│ ├── uniform_polar(left: typing.Union[int, float], right: typing.Union[int, float], mod: typing.Union[int, float], angle: typing.Union[int, float]) -> complex
|
|
355
|
+
│ └── uniform_rect(left: typing.Union[int, float], right: typing.Union[int, float], real: typing.Union[int, float], imag: typing.Union[int, float]) -> complex
|
|
356
|
+
├── dataproc
|
|
357
|
+
│ ├── CLASS
|
|
358
|
+
│ │ └── Series(object)/__init__(self: Any, data: typing.Any, index: typing.Any) -> None
|
|
359
|
+
├── maths
|
|
360
|
+
│ └── FUNCTION
|
|
361
|
+
│ ├── quantile(data: list, q: float, interpolation: str, ordered: bool) -> float
|
|
362
|
+
├── numbers
|
|
363
|
+
│ └── FUNCTION
|
|
364
|
+
│ ├── parse_float(s: str) -> tuple
|
|
365
|
+
│ ├── split_float(s: str) -> tuple
|
|
377
366
|
|
|
378
367
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
379
368
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
placing it in a new submodule - pypynum.interp - along with the newly added interp2d function.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
Help on module pypynum.interp in pypynum:
|
|
388
|
-
|
|
389
|
-
NAME
|
|
390
|
-
pypynum.interp
|
|
391
|
-
|
|
392
|
-
FUNCTIONS
|
|
393
|
-
bicubic(x)
|
|
394
|
-
Calculate the cubic B-spline interpolation function value.
|
|
395
|
-
:param x: The x value for which the B-spline function is evaluated.
|
|
396
|
-
:return: The value of the cubic B-spline function at x.
|
|
397
|
-
|
|
398
|
-
contribute(src, x, y, channels=None)
|
|
399
|
-
Calculate the contribution of the source array at a specific point after bicubic interpolation.
|
|
400
|
-
:param src: The source 2D array from which to interpolate.
|
|
401
|
-
:param x: The x-coordinate of the point to interpolate.
|
|
402
|
-
:param y: The y-coordinate of the point to interpolate.
|
|
403
|
-
:param channels: The number of channels if src is a multichannel array.
|
|
404
|
-
:return: The interpolated value at the point (x, y).
|
|
405
|
-
|
|
406
|
-
interp1d(data: Union[list, tuple], length: int) -> list
|
|
407
|
-
Introduction
|
|
408
|
-
==========
|
|
409
|
-
One-dimensional data interpolation
|
|
410
|
-
|
|
411
|
-
Example
|
|
412
|
-
==========
|
|
413
|
-
>>> interp1d((2, 4, 4, 2), 6)
|
|
414
|
-
[2, 3.320000000000001, 4.160000000000005, 4.160000000000012, 3.3200000000000074, 2]
|
|
415
|
-
>>>
|
|
416
|
-
:param data: List of data points to be interpolated. Must be at least two points.
|
|
417
|
-
:param length: The number of points in the resampled data set.
|
|
418
|
-
:return: A list of interpolated values at the new points.
|
|
419
|
-
|
|
420
|
-
interp2d(src, new_height, new_width, channels=None, round_res=False, min_val=None, max_val=None)
|
|
421
|
-
Introduction
|
|
422
|
-
==========
|
|
423
|
-
Two-dimensional data interpolation using bicubic spline interpolation.
|
|
424
|
-
|
|
425
|
-
Example
|
|
426
|
-
==========
|
|
427
|
-
>>> interp2d([[1, 2], [3, 4]], 3, 3)
|
|
428
|
-
[[1.0, 1.6875, 2.0], [2.25, 3.1640625, 3.375], [3.0, 3.9375, 4.0]]
|
|
429
|
-
>>>
|
|
430
|
-
:param src: The source 2D array to be interpolated.
|
|
431
|
-
:param new_height: The desired height of the interpolated array.
|
|
432
|
-
:param new_width: The desired width of the interpolated array.
|
|
433
|
-
:param channels: The number of channels if src is a multichannel array.
|
|
434
|
-
:param round_res: Whether to round the result to the nearest integer.
|
|
435
|
-
:param min_val: The minimum value to clip the interpolated results.
|
|
436
|
-
:param max_val: The maximum value to clip the interpolated results.
|
|
437
|
-
:return: A 2D array of the interpolated values with the new dimensions.
|
|
369
|
+
Tip: The second type of Bessel
|
|
370
|
+
function has not been
|
|
371
|
+
implemented yet, but will be
|
|
372
|
+
added in future versions.
|
|
438
373
|
|
|
439
374
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
440
375
|
```
|
|
441
376
|
|
|
442
|
-
###
|
|
443
|
-
|
|
444
|
-
#### Run Time Test
|
|
445
|
-
|
|
446
|
-
Python解释器版本
|
|
377
|
+
### Run Time Test
|
|
447
378
|
|
|
448
379
|
Python interpreter version
|
|
449
380
|
|
|
@@ -451,31 +382,31 @@ Python interpreter version
|
|
|
451
382
|
|
|
452
383
|
+ PyPy 3.10.12
|
|
453
384
|
|
|
454
|
-
|
|
|
455
|
-
|
|
456
|
-
|
|
|
457
|
-
|
|
|
458
|
-
|
|
|
459
|
-
|
|
|
460
|
-
|
|
|
461
|
-
|
|
|
462
|
-
|
|
|
463
|
-
|
|
|
464
|
-
|
|
|
465
|
-
|
|
466
|
-
### 基本结构
|
|
385
|
+
| Matrix Time Test | NumPy+CPython (seconds) | Ranking | PyPyNum+PyPy (seconds) | Ranking | Mpmath_+_PyPy_ (seconds) | Ranking | SymPy_+_PyPy_ (seconds) | Ranking |
|
|
386
|
+
|------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
|
|
387
|
+
| Create a hundred order random number matrix | 0.000083 | 1 | 0.005374 | 2 | 0.075253 | 3 | 0.230530 | 4 |
|
|
388
|
+
| Create a thousand order random number matrix | 0.006740 | 1 | 0.035666 | 2 | 1.200950 | 3 | 4.370265 | 4 |
|
|
389
|
+
| Addition of matrices of order one hundred | 0.000029 | 1 | 0.002163 | 2 | 0.045641 | 4 | 0.035700 | 3 |
|
|
390
|
+
| Adding matrices of order one thousand | 0.002647 | 1 | 0.019111 | 2 | 1.746957 | 4 | 0.771542 | 3 |
|
|
391
|
+
| Determinant of a hundred order matrix | 0.087209 | 2 | 0.016331 | 1 | 4.354507 | 3 | 5.157206 | 4 |
|
|
392
|
+
| Determinant of a thousand order matrix | 0.616113 | 1 | 3.509747 | 2 | It takes a long time | 3 | It takes a long time | 4 |
|
|
393
|
+
| Finding the inverse of a hundred order matrix | 0.162770 | 2 | 0.015768 | 1 | 8.162948 | 3 | 21.437424 | 4 |
|
|
394
|
+
| Finding the inverse of a thousand order matrix | 0.598905 | 1 | 17.072552 | 2 | It takes a long time | 3 | It takes a long time | 4 |
|
|
395
|
+
| Array output effect | ```[[[[ -7 -67]```<br>```[-78 29]]```<br><br>```[[-86 -97]```<br>```[ 68 -3]]]```<br><br><br>```[[[ 11 42]```<br>```[ 24 -65]]```<br><br>```[[-60 72]```<br>```[ 73 2]]]]``` | / | ```[[[[ 37 83]```<br>```[ 40 2]]```<br><br>```[[ -5 -34]```<br>```[ -7 72]]]```<br><br><br>```[[[ 13 -64]```<br>```[ 6 90]]```<br><br>```[[ 68 57]```<br>```[ 78 11]]]]``` | / | ```[-80.0 -8.0 80.0 -88.0]```<br>```[-99.0 -43.0 87.0 81.0]```<br>```[ 20.0 -55.0 98.0 8.0]```<br>```[ 8.0 44.0 64.0 -35.0]```<br><br>(Only supports matrices) | / | ```⎡⎡16 -56⎤ ⎡ 8 -28⎤⎤```<br>```⎢⎢ ⎥ ⎢ ⎥⎥```<br>```⎢⎣-56 56 ⎦ ⎣-28 28 ⎦⎥```<br>```⎢ ⎥```<br>```⎢ ⎡-2 7 ⎤ ⎡-18 63 ⎤⎥```<br>```⎢ ⎢ ⎥ ⎢ ⎥⎥```<br>```⎣ ⎣7 -7⎦ ⎣63 -63⎦⎦``` | / |
|
|
467
396
|
|
|
468
|
-
|
|
397
|
+
### Basic structure
|
|
469
398
|
|
|
470
399
|
```
|
|
471
400
|
PyPyNum
|
|
472
401
|
├── Array
|
|
473
402
|
│ ├── CLASS
|
|
474
|
-
│ │
|
|
403
|
+
│ │ ├── Array(object)/__init__(self: Any, data: Any, check: Any) -> Any
|
|
404
|
+
│ │ └── BoolArray(pypynum.Array.Array)/__init__(self: Any, data: Any, check: Any) -> Any
|
|
475
405
|
│ └── FUNCTION
|
|
476
406
|
│ ├── array(data: Any) -> Any
|
|
477
407
|
│ ├── asarray(data: Any) -> Any
|
|
478
408
|
│ ├── aslist(data: Any) -> Any
|
|
409
|
+
│ ├── boolarray(data: Any) -> Any
|
|
479
410
|
│ ├── fill(shape: Any, sequence: Any, repeat: Any, pad: Any, rtype: Any) -> Any
|
|
480
411
|
│ ├── full(shape: Any, fill_value: Any, rtype: Any) -> Any
|
|
481
412
|
│ ├── full_like(a: Any, fill_value: Any, rtype: Any) -> Any
|
|
@@ -590,6 +521,15 @@ PyPyNum
|
|
|
590
521
|
│ │ └── Vector(pypynum.Array.Array)/__init__(self: Any, data: Any, check: Any) -> Any
|
|
591
522
|
│ └── FUNCTION
|
|
592
523
|
│ └── vec(data: Any) -> Any
|
|
524
|
+
├── bessel
|
|
525
|
+
│ ├── CLASS
|
|
526
|
+
│ └── FUNCTION
|
|
527
|
+
│ ├── bessel_i0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
528
|
+
│ ├── bessel_i1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
529
|
+
│ ├── bessel_iv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
530
|
+
│ ├── bessel_j0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
531
|
+
│ ├── bessel_j1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
532
|
+
│ └── bessel_jv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
593
533
|
├── chars
|
|
594
534
|
│ ├── CLASS
|
|
595
535
|
│ └── FUNCTION
|
|
@@ -618,6 +558,19 @@ PyPyNum
|
|
|
618
558
|
├── constants
|
|
619
559
|
│ ├── CLASS
|
|
620
560
|
│ └── FUNCTION
|
|
561
|
+
├── crandom
|
|
562
|
+
│ ├── CLASS
|
|
563
|
+
│ └── FUNCTION
|
|
564
|
+
│ ├── randint_polar(left: int, right: int, mod: typing.Union[int, float], angle: typing.Union[int, float]) -> complex
|
|
565
|
+
│ ├── randint_rect(left: int, right: int, real: typing.Union[int, float], imag: typing.Union[int, float]) -> complex
|
|
566
|
+
│ ├── random_polar(mod: typing.Union[int, float], angle: typing.Union[int, float]) -> complex
|
|
567
|
+
│ ├── random_rect(real: typing.Union[int, float], imag: typing.Union[int, float]) -> complex
|
|
568
|
+
│ ├── uniform_polar(left: typing.Union[int, float], right: typing.Union[int, float], mod: typing.Union[int, float], angle: typing.Union[int, float]) -> complex
|
|
569
|
+
│ └── uniform_rect(left: typing.Union[int, float], right: typing.Union[int, float], real: typing.Union[int, float], imag: typing.Union[int, float]) -> complex
|
|
570
|
+
├── dataproc
|
|
571
|
+
│ ├── CLASS
|
|
572
|
+
│ │ └── Series(object)/__init__(self: Any, data: typing.Any, index: typing.Any) -> None
|
|
573
|
+
│ └── FUNCTION
|
|
621
574
|
├── dists
|
|
622
575
|
│ ├── CLASS
|
|
623
576
|
│ └── FUNCTION
|
|
@@ -701,8 +654,6 @@ PyPyNum
|
|
|
701
654
|
│ ├── atan(x: typing.Union[int, float]) -> typing.Union[int, float]
|
|
702
655
|
│ ├── atanh(x: typing.Union[int, float]) -> typing.Union[int, float]
|
|
703
656
|
│ ├── average(data: typing.Union[list, tuple], weights: typing.Union[list, tuple]) -> float
|
|
704
|
-
│ ├── bessel_i0(x: typing.Union[int, float]) -> typing.Union[int, float]
|
|
705
|
-
│ ├── bessel_iv(v: typing.Union[int, float], x: typing.Union[int, float]) -> typing.Union[int, float]
|
|
706
657
|
│ ├── beta(p: typing.Union[int, float], q: typing.Union[int, float]) -> typing.Union[int, float]
|
|
707
658
|
│ ├── central_moment(data: typing.Union[list, tuple], order: int) -> float
|
|
708
659
|
│ ├── coeff_det(x: typing.Union[list, tuple], y: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
|
|
@@ -747,6 +698,7 @@ PyPyNum
|
|
|
747
698
|
│ ├── primitive_root(a: int, single: bool) -> typing.Union[int, list]
|
|
748
699
|
│ ├── product(numbers: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
|
|
749
700
|
│ ├── ptp(numbers: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
|
|
701
|
+
│ ├── quantile(data: list, q: float, interpolation: str, ordered: bool) -> float
|
|
750
702
|
│ ├── raw_moment(data: typing.Union[list, tuple], order: int) -> float
|
|
751
703
|
│ ├── roll(seq: typing.Union[list, tuple, str], shift: int) -> typing.Union[list, tuple, str]
|
|
752
704
|
│ ├── root(x: typing.Union[int, float, complex], y: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
@@ -798,7 +750,9 @@ PyPyNum
|
|
|
798
750
|
│ ├── float2fraction(number: float, mixed: bool, error: float) -> tuple
|
|
799
751
|
│ ├── int2roman(integer: int, overline: bool) -> str
|
|
800
752
|
│ ├── int2words(integer: int) -> str
|
|
753
|
+
│ ├── parse_float(s: str) -> tuple
|
|
801
754
|
│ ├── roman2int(roman_num: str) -> int
|
|
755
|
+
│ ├── split_float(s: str) -> tuple
|
|
802
756
|
│ └── str2int(string: str) -> int
|
|
803
757
|
├── plotting
|
|
804
758
|
│ ├── CLASS
|
|
@@ -876,6 +830,7 @@ PyPyNum
|
|
|
876
830
|
│ ├── generate_primes(limit: int) -> list
|
|
877
831
|
│ ├── generate_semiprimes(limit: int) -> list
|
|
878
832
|
│ ├── geomspace(start: typing.Union[int, float], stop: typing.Union[int, float], number: int) -> list
|
|
833
|
+
│ ├── levenshtein_distance(s1: str, s2: str) -> int
|
|
879
834
|
│ ├── linspace(start: typing.Union[int, float], stop: typing.Union[int, float], number: int) -> list
|
|
880
835
|
│ ├── magic_square(n: Any) -> Any
|
|
881
836
|
│ ├── primality(n: int, iter_num: int) -> bool
|
|
@@ -888,11 +843,18 @@ PyPyNum
|
|
|
888
843
|
│ ├── CLASS
|
|
889
844
|
│ └── FUNCTION
|
|
890
845
|
│ ├── add(x: Any, y: Any) -> Any
|
|
846
|
+
│ ├── apply(a: Any, func: Any, rtype: Any) -> Any
|
|
891
847
|
│ ├── base_ufunc(arrays: Any, func: Any, args: Any, rtype: Any) -> Any
|
|
892
848
|
│ ├── divide(x: Any, y: Any) -> Any
|
|
849
|
+
│ ├── eq(x: Any, y: Any) -> Any
|
|
893
850
|
│ ├── floor_divide(x: Any, y: Any) -> Any
|
|
851
|
+
│ ├── ge(x: Any, y: Any) -> Any
|
|
852
|
+
│ ├── gt(x: Any, y: Any) -> Any
|
|
853
|
+
│ ├── le(x: Any, y: Any) -> Any
|
|
854
|
+
│ ├── lt(x: Any, y: Any) -> Any
|
|
894
855
|
│ ├── modulo(x: Any, y: Any) -> Any
|
|
895
856
|
│ ├── multiply(x: Any, y: Any) -> Any
|
|
857
|
+
│ ├── ne(x: Any, y: Any) -> Any
|
|
896
858
|
│ ├── power(x: Any, y: Any, m: Any) -> Any
|
|
897
859
|
│ ├── subtract(x: Any, y: Any) -> Any
|
|
898
860
|
│ └── ufunc_helper(x: Any, y: Any, func: Any) -> Any
|
|
@@ -938,6 +900,7 @@ PyPyNum
|
|
|
938
900
|
├── 写入(文件: str, 对象: object) -> Any
|
|
939
901
|
├── 几何平均数(数据: typing.List[float]) -> float
|
|
940
902
|
├── 凯撒密码(文本: str, 移位: int, 解密: bool) -> str
|
|
903
|
+
├── 分位数(数据: list, 分位值: float, 插值方法: str, 已排序: bool) -> float
|
|
941
904
|
├── 判定系数(x: typing.List[float], y: typing.List[float]) -> float
|
|
942
905
|
├── 判断平方数(n: int) -> bool
|
|
943
906
|
├── 加权平均(数据: typing.List[float], 权重: typing.List[float]) -> float
|
|
@@ -993,6 +956,7 @@ PyPyNum
|
|
|
993
956
|
├── 序列滚动(序列: typing.Iterator[typing.Any], 偏移: int) -> typing.Iterator[typing.Any]
|
|
994
957
|
├── 归一化(数据: typing.List[float], 目标: float) -> typing.List[float]
|
|
995
958
|
├── 扩展欧几里得算法(a: int, b: int) -> typing.Tuple[int, int, int]
|
|
959
|
+
├── 拆分浮点数字符串(字符串: str) -> tuple
|
|
996
960
|
├── 排列数(总数: int, 选取数: int) -> int
|
|
997
961
|
├── 数组(数据: list, 检查: bool) -> pypynum.Array.Array
|
|
998
962
|
├── 整数转上标(标准字符串: str) -> str
|
|
@@ -1027,12 +991,17 @@ PyPyNum
|
|
|
1027
991
|
├── 自然对数(真数: typing.Union[int, float]) -> typing.Union[int, float]
|
|
1028
992
|
├── 自然指数(指数: typing.Union[int, float]) -> typing.Union[int, float]
|
|
1029
993
|
├── 莫尔斯密码(文本: str, 解密: bool) -> str
|
|
994
|
+
├── 解析浮点数字符串(字符串: str) -> tuple
|
|
1030
995
|
├── 误差函数(x: typing.Union[int, float]) -> typing.Union[int, float]
|
|
1031
996
|
├── 读取(文件: str) -> list
|
|
1032
997
|
├── 调和平均数(数据: typing.List[float]) -> float
|
|
1033
998
|
├── 贝塔函数(p: float, q: float) -> float
|
|
1034
|
-
├──
|
|
1035
|
-
├──
|
|
999
|
+
├── 贝塞尔函数I0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
1000
|
+
├── 贝塞尔函数I1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
1001
|
+
├── 贝塞尔函数Iv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
1002
|
+
├── 贝塞尔函数J0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
1003
|
+
├── 贝塞尔函数J1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
1004
|
+
├── 贝塞尔函数Jv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
1036
1005
|
├── 负一整数次幂(指数: int) -> int
|
|
1037
1006
|
├── 转为多精度复数(实部: typing.Union[int, float, str, decimal.Decimal, complex, pypynum.multiprec.MPComplex], 虚部: typing.Union[int, float, str, decimal.Decimal], 有效位数: int) -> pypynum.multiprec.MPComplex
|
|
1038
1007
|
├── 转换为列表(数据: Any) -> list
|
|
@@ -1045,9 +1014,7 @@ PyPyNum
|
|
|
1045
1014
|
└── 黎曼函数(alpha: float) -> float
|
|
1046
1015
|
```
|
|
1047
1016
|
|
|
1048
|
-
###
|
|
1049
|
-
|
|
1050
|
-
#### Code testing
|
|
1017
|
+
### Code testing
|
|
1051
1018
|
|
|
1052
1019
|
```python
|
|
1053
1020
|
from pypynum import (Array, Geometry, Logic, Matrix, Quaternion, Symbolics, Tensor, Vector,
|
|
@@ -1256,8 +1223,8 @@ print(equations.poly_eq(p))
|
|
|
1256
1223
|
print(equations.lin_eq(*m))
|
|
1257
1224
|
|
|
1258
1225
|
"""
|
|
1259
|
-
[(-1.5615528128088307-6.5209667308287455e-24j)
|
|
1260
|
-
[
|
|
1226
|
+
[(-1.5615528128088307-6.5209667308287455e-24j), (1.0000000000000007+3.241554513744382e-25j), (2.5615528128088294+4.456233626665941e-24j)]
|
|
1227
|
+
[1.6666666666666665, -0.6666666666666666, -0.4444444444444444]
|
|
1261
1228
|
"""
|
|
1262
1229
|
|
|
1263
1230
|
print(maths.cot(constants.pi / 3))
|
|
@@ -1357,10 +1324,10 @@ print(random.randint(0, 9, [2, 3, 4]))
|
|
|
1357
1324
|
print(random.uniform(0, 9, [2, 3, 4]))
|
|
1358
1325
|
|
|
1359
1326
|
"""
|
|
1360
|
-
[[[
|
|
1361
|
-
[[[0.
|
|
1362
|
-
[[[
|
|
1363
|
-
[[[
|
|
1327
|
+
[[[0.015128082827448793, -0.731558889632968, -0.23379102528494308, 0.5923285646572862], [0.6389462900078073, -1.6347914510943111, 2.3694029836271726, -0.568526047386569], [-1.4229328154353735, 0.45185125607678145, -0.4003256267251042, -1.1425679894907612]], [[1.2876668616276734, 0.934232416262927, -1.4096609242818299, 0.2683613962988281], [0.3503627719719857, 1.9613965063102903, -2.0790609695353077, -0.10339725500993839], [-0.9334087233797456, 1.1394611182611, 1.3341558691128073, -0.3838574172857678]]]
|
|
1328
|
+
[[[0.8274205130045614, 0.27524584776494854, 0.715710895889572, 0.5807271906102146], [0.21742840470887725, 0.04577819370109826, 0.873689463957162, 0.04119770233167375], [0.554823367037196, 0.5901404246422433, 0.21342393541488192, 0.2979716283166385]], [[0.6045948602408673, 0.265586003384665, 0.9646655285283718, 0.9873208424367568], [0.16916505841642293, 0.15942804932580645, 0.679004396069304, 0.4586819952716237], [0.6058239213086706, 0.37021967026096103, 0.0015603885735545608, 0.8432925281217005]]]
|
|
1329
|
+
[[[7, 2, 9, 7], [0, 5, 1, 3], [9, 1, 0, 2]], [[1, 2, 7, 5], [5, 7, 4, 1], [2, 5, 7, 9]]]
|
|
1330
|
+
[[[1.6682230173222767, 0.5174279535822173, 6.202024157209834, 5.097176032335483], [3.44538825088208, 3.7119354081208025, 4.584800897579607, 8.294514147889751], [7.201908571787272, 4.96544760729807, 5.896259095293225, 3.215472062129558]], [[6.352678024277219, 6.894646335413341, 2.0445980257056333, 1.5835361381716893], [6.363077167625872, 8.831103031792672, 6.229821243776864, 0.5639371628314593], [7.639545178199688, 8.079077083978365, 8.063058392021144, 8.673394953496695]]]
|
|
1364
1331
|
"""
|
|
1365
1332
|
|
|
1366
1333
|
print(regression.lin_reg(list(range(5)), [2, 4, 6, 7, 8]))
|
|
@@ -1385,19 +1352,8 @@ print(tools.linspace(0, 2.8, 8))
|
|
|
1385
1352
|
[0.0, 0.39999999999999997, 0.7999999999999999, 1.2, 1.5999999999999999, 1.9999999999999998, 2.4, 2.8]
|
|
1386
1353
|
"""
|
|
1387
1354
|
|
|
1388
|
-
# 提示:
|
|
1389
|
-
#
|
|
1390
|
-
# 测试已成功通过并结束。
|
|
1391
|
-
#
|
|
1392
|
-
# 这些测试只是这个包功能的一部分。
|
|
1393
|
-
#
|
|
1394
|
-
# 更多的功能需要自己探索和尝试!
|
|
1395
|
-
#
|
|
1396
1355
|
# Tip:
|
|
1397
|
-
#
|
|
1398
1356
|
# The test has been successfully passed and ended.
|
|
1399
|
-
#
|
|
1400
1357
|
# These tests are only part of the functionality of this package.
|
|
1401
|
-
#
|
|
1402
1358
|
# More features need to be explored and tried by yourself!
|
|
1403
1359
|
```
|