PyPyNum 1.18.1__tar.gz → 1.19.0__tar.gz

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.
Files changed (58) hide show
  1. {pypynum-1.18.1 → pypynum-1.19.0}/PKG-INFO +230 -256
  2. {pypynum-1.18.1 → pypynum-1.19.0}/PyPyNum.egg-info/PKG-INFO +230 -256
  3. {pypynum-1.18.1 → pypynum-1.19.0}/PyPyNum.egg-info/SOURCES.txt +0 -1
  4. pypynum-1.19.0/pypynum/PyPyNum.png +0 -0
  5. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/README.md +229 -255
  6. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/__init__.py +1 -1
  7. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/arrays.py +66 -41
  8. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/dists.py +85 -87
  9. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/graphs.py +53 -25
  10. pypynum-1.19.0/pypynum/images.py +3279 -0
  11. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/maths.py +10 -58
  12. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/matrices.py +142 -41
  13. pypynum-1.19.0/pypynum/plotting.py +388 -0
  14. pypynum-1.19.0/pypynum/test.py +438 -0
  15. pypynum-1.19.0/pypynum/ufuncs.py +269 -0
  16. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/zh_cn.py +0 -20
  17. {pypynum-1.18.1 → pypynum-1.19.0}/setup.py +12 -8
  18. pypynum-1.18.1/pypynum/PyPyNum.png +0 -0
  19. pypynum-1.18.1/pypynum/huffman +0 -1
  20. pypynum-1.18.1/pypynum/images.py +0 -902
  21. pypynum-1.18.1/pypynum/plotting.py +0 -180
  22. pypynum-1.18.1/pypynum/test.py +0 -354
  23. pypynum-1.18.1/pypynum/ufuncs.py +0 -120
  24. {pypynum-1.18.1 → pypynum-1.19.0}/PyPyNum.egg-info/dependency_links.txt +0 -0
  25. {pypynum-1.18.1 → pypynum-1.19.0}/PyPyNum.egg-info/top_level.txt +0 -0
  26. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/chars.py +0 -0
  27. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/ciphers.py +0 -0
  28. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/consts.py +0 -0
  29. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/crandom.py +0 -0
  30. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/dataproc.py +0 -0
  31. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/equations.py +0 -0
  32. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/fft.py +0 -0
  33. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/files.py +0 -0
  34. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/geoms.py +0 -0
  35. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/groups.py +0 -0
  36. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/hypcmpnms.py +0 -0
  37. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/interp.py +0 -0
  38. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/kernels.py +0 -0
  39. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/logics.py +0 -0
  40. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/multiprec.py +0 -0
  41. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/networks.py +0 -0
  42. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/numbers.py +0 -0
  43. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/polys.py +0 -0
  44. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/pprinters.py +0 -0
  45. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/random.py +0 -0
  46. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/regs.py +0 -0
  47. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/seqs.py +0 -0
  48. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/special.py +0 -0
  49. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/stattest.py +0 -0
  50. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/symbols.py +0 -0
  51. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/tensors.py +0 -0
  52. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/this.py +0 -0
  53. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/tools.py +0 -0
  54. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/trees.py +0 -0
  55. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/types.py +0 -0
  56. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/utils.py +0 -0
  57. {pypynum-1.18.1 → pypynum-1.19.0}/pypynum/vectors.py +0 -0
  58. {pypynum-1.18.1 → pypynum-1.19.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyPyNum
3
- Version: 1.18.1
3
+ Version: 1.19.0
4
4
  Summary: PyPyNum is a versatile Python math lib. It features modules for math, data analysis, arrays, crypto, physics, RNG, data proc, stats, eq solving, image proc, interp, matrix calc, and high-prec math. Designed for scientific computing, data science, and ML, it offers efficient, general-purpose tools.
5
5
  Home-page: https://github.com/PythonSJL/PyPyNum
6
6
  Author: Shen Jiayi
@@ -40,7 +40,7 @@ science, and ML, it offers efficient, general-purpose tools.
40
40
  [![Downloads](https://static.pepy.tech/badge/pypynum/month)](https://pepy.tech/project/pypynum)
41
41
  [![Downloads](https://static.pepy.tech/badge/pypynum/week)](https://pepy.tech/project/pypynum)
42
42
 
43
- ## PyPyNum | Version -> 1.18.1 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
43
+ ## PyPyNum | Version -> 1.19.0 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
44
44
 
45
45
  ![LOGO](PyPyNum.png)
46
46
 
@@ -169,10 +169,52 @@ Python interpreter and run it!
169
169
 
170
170
  ### Functional Changes Compared to the Previous Version
171
171
 
172
- > 1. The `hypcmpnms` module added hypercomplex exponential and logarithmic operations.
173
- > 2. The `dists` module fixed all calculation errors.
174
- > 3. The `geoms` module fixed calculation errors and added more features.
175
- > 4. The `utils` module fixed calculation errors in the `IntervalSet` class.
172
+ **`pypynum.images`**
173
+
174
+ - Added comprehensive support for the **GIF format**, including LZW encoding/decoding, multi-frame animations,
175
+ interlacing, and local/global palettes.
176
+ - Completely rewrote the **JPEG** module: now supports **progressive JPEG**, chroma subsampling (e.g., 4:2:0), grayscale
177
+ images, restart markers, and dynamic Huffman tree construction.
178
+ - Extended **PNG** and **BMP** support to handle low-bit-depth indexed colors (1/2/4-bit) and grayscale modes. Added
179
+ support for PNG Adam7 interlacing.
180
+ - Introduced octree color quantization and universal image format conversion (e.g., converting between BMP, PNG, JPEG,
181
+ and GIF with specific color modes).
182
+
183
+ **`pypynum.plotting`**
184
+
185
+ - Refactored the plotting module into an object-oriented `Canvas` class for better state management and rendering.
186
+ - Significantly improved the contour plotting algorithm by implementing adaptive quadtree subdivision and Lipschitz
187
+ constant interval pruning, replacing the previous brute-force pixel scanning.
188
+
189
+ **`pypynum.ufuncs`**
190
+
191
+ - Added a suite of advanced special functions with full support for complex numbers and arrays: `gamma`, `loggamma`,
192
+ `beta`, `logbeta`, `factorial`, `logfactorial`, `pochhammer`, and `binomial`.
193
+ - Added `dtype` parameter support to universal function applications for better type control.
194
+
195
+ **`pypynum.maths`**
196
+
197
+ - Enhanced statistical functions (`ptp`, `median`, `mean`, `var`, `std`) to fully support complex number sequences.
198
+
199
+ **`pypynum.graphs`**
200
+
201
+ - Improved vertex removal logic to safely handle unconnected nodes across all graph types.
202
+ - Enhanced `dijkstra` and path reconstruction algorithms to correctly handle unreachable vertices and use all graph
203
+ vertices for initialization.
204
+ - `all_edges()` now returns weights as a third element for weighted graphs.
205
+
206
+ **`pypynum.arrays` & `pypynum.matrices`**
207
+
208
+ - Improved multidimensional array indexing: integer and slice indexing now correctly returns the appropriate subtype (
209
+ `Array` or `Matrix`) rather than raw lists.
210
+ - Added complex number support for `max`, `min`, `argmax`, and `argmin` operations.
211
+ - `basic()` now accepts a `dtype` parameter and properly reshapes 1D results into single-row matrices.
212
+
213
+ **`pypynum.dists`**
214
+
215
+ - Standardized parameter names and orderings across multiple statistical distributions for a more intuitive interface (
216
+ e.g., `scale` -> `lam` for exponential/Poisson distributions, updated parameter models for uniform, Pareto, and
217
+ Weibull distributions).
176
218
 
177
219
  ### Run Time Test
178
220
 
@@ -201,11 +243,9 @@ PyPyNum
201
243
  ├── arrays
202
244
  │ ├── CLASS
203
245
  │ │ ├── Array(object)/__init__(self: Any, data: Any, check: Any, dtype: Any) -> Any
204
- │ │ └── BoolArray(pypynum.arrays.Array)/__init__(self: Any, data: Any, check: Any) -> Any
246
+ │ │ └── BoolArray(pypynum.arrays.Array)/__init__(self: Any, data: Any, check: Any, dtype: Any) -> Any
205
247
  │ └── FUNCTION
206
248
  │ ├── array(data: Any, dtype: Any) -> Any
207
- │ ├── asarray(data: Any, dtype: Any) -> Any
208
- │ ├── aslist(data: Any) -> Any
209
249
  │ ├── boolarray(data: Any) -> Any
210
250
  │ ├── fill(shape: typing.Sequence, sequence: typing.Sequence, repeat: bool, pad: typing.Any, rtype: typing.Callable, dtype: type) -> typing.Any
211
251
  │ ├── full(shape: typing.Sequence, fill_value: typing.Any, rtype: typing.Callable, dtype: type) -> typing.Any
@@ -264,12 +304,12 @@ PyPyNum
264
304
  │ ├── cauchy_pdf(x: Any, x0: Any, gamma: Any) -> Any
265
305
  │ ├── chi2_cdf(x: Any, df: Any) -> Any
266
306
  │ ├── chi2_pdf(x: Any, df: Any) -> Any
267
- │ ├── expon_cdf(x: Any, scale: Any) -> Any
268
- │ ├── expon_pdf(x: Any, scale: Any) -> Any
307
+ │ ├── expon_cdf(x: Any, lam: Any) -> Any
308
+ │ ├── expon_pdf(x: Any, lam: Any) -> Any
269
309
  │ ├── f_pdf(x: Any, dfnum: Any, dfden: Any) -> Any
270
310
  │ ├── gamma_pdf(x: Any, shape: Any, scale: Any) -> Any
271
311
  │ ├── geometric_pmf(k: Any, p: Any) -> Any
272
- │ ├── hypergeom_pmf(M: Any, n: Any, N: Any, k: Any) -> Any
312
+ │ ├── hypergeom_pmf(k: Any, N: Any, K: Any, n: Any) -> Any
273
313
  │ ├── invgauss_pdf(x: Any, mu: Any, lam: Any) -> Any
274
314
  │ ├── levy_pdf(x: Any, c: Any) -> Any
275
315
  │ ├── log_logistic_cdf(x: Any, alpha: Any, beta: Any) -> Any
@@ -280,19 +320,19 @@ PyPyNum
280
320
  │ ├── lognorm_pdf(x: Any, mu: Any, sigma: Any) -> Any
281
321
  │ ├── logser_pmf(k: Any, p: Any) -> Any
282
322
  │ ├── multinomial_pmf(k: Any, n: Any, p: Any) -> Any
283
- │ ├── nbinom_pmf(k: Any, n: Any, p: Any) -> Any
284
- │ ├── nhypergeom_pmf(M: Any, n: Any, r: Any, k: Any) -> Any
323
+ │ ├── nbinom_pmf(k: Any, r: Any, p: Any) -> Any
324
+ │ ├── nhypergeom_pmf(k: Any, N: Any, K: Any, r: Any) -> Any
285
325
  │ ├── normal_cdf(x: Any, mu: Any, sigma: Any) -> Any
286
326
  │ ├── normal_pdf(x: Any, mu: Any, sigma: Any) -> Any
287
- │ ├── pareto_pdf(x: Any, b: Any, scale: Any) -> Any
288
- │ ├── poisson_pmf(k: Any, mu: Any) -> Any
327
+ │ ├── pareto_pdf(x: Any, alpha: Any, x_m: Any) -> Any
328
+ │ ├── poisson_pmf(k: Any, lam: Any) -> Any
289
329
  │ ├── rayleigh_pdf(x: Any, sigma: Any) -> Any
290
330
  │ ├── t_pdf(x: Any, df: Any) -> Any
291
- │ ├── uniform_cdf(x: Any, loc: Any, scale: Any) -> Any
292
- │ ├── uniform_pdf(x: Any, loc: Any, scale: Any) -> Any
331
+ │ ├── uniform_cdf(x: Any, a: Any, b: Any) -> Any
332
+ │ ├── uniform_pdf(x: Any, a: Any, b: Any) -> Any
293
333
  │ ├── vonmises_pdf(x: Any, mu: Any, kappa: Any) -> Any
294
- │ ├── weibull_max_pdf(x: Any, c: Any, scale: Any, loc: Any) -> Any
295
- │ ├── weibull_min_pdf(x: Any, c: Any, scale: Any, loc: Any) -> Any
334
+ │ ├── weibull_max_pdf(x: Any, k: Any, scale: Any, loc: Any) -> Any
335
+ │ ├── weibull_min_pdf(x: Any, k: Any, scale: Any, loc: Any) -> Any
296
336
  │ └── zipf_pmf(k: Any, s: Any, n: Any) -> Any
297
337
  ├── equations
298
338
  │ ├── CLASS
@@ -348,22 +388,38 @@ PyPyNum
348
388
  │ ├── CLASS
349
389
  │ │ ├── BMP(pypynum.images.BaseImage)/__init__(self: Any) -> None
350
390
  │ │ ├── BaseImage(object)/__init__(self: Any) -> None
391
+ │ │ ├── GIF(pypynum.images.BaseImage)/__init__(self: Any) -> None
351
392
  │ │ ├── JPEG(pypynum.images.BaseImage)/__init__(self: Any) -> None
352
- │ │ └── PNG(pypynum.images.BaseImage)/__init__(self: Any) -> None
393
+ │ │ ├── OctreeNode(object)/__init__(self: Any, level: Any, parent: Any) -> Any
394
+ │ │ ├── PNG(pypynum.images.BaseImage)/__init__(self: Any) -> None
395
+ │ │ ├── _BitReader(object)/__init__(self: Any, data: bytes) -> None
396
+ │ │ └── _BitWriter(object)/__init__(self: Any) -> None
353
397
  │ └── FUNCTION
398
+ │ ├── __dht2dict(dht_bytes: Any) -> Any
399
+ │ ├── _deinterlace(pixels: list, w: int, h: int) -> list
400
+ │ ├── _find_closest_color(color: Any, palette: Any, octree_root: Any) -> int
401
+ │ ├── _interlace(pixels: list, w: int, h: int) -> list
402
+ │ ├── _lzw_decode(min_code_size: int, data: bytes) -> list
403
+ │ ├── _lzw_encode(min_code_size: int, pixels: list) -> bytes
404
+ │ ├── _norm_palette(pal: list) -> list
405
+ │ ├── _read_sub_blocks(data: bytes, offset: int) -> tuple
406
+ │ ├── _write_sub_blocks(raw: bytes) -> bytes
354
407
  │ ├── entropy(data: typing.Any) -> float
355
408
  │ ├── jpeg_adjust_qtable(qtable: typing.Union[list, tuple], quality: int) -> list
356
409
  │ ├── jpeg_category(data: typing.Any, reverse: bool) -> typing.Any
357
410
  │ ├── jpeg_channel_encoding(matrix: list, quality: int, mode: int) -> tuple
358
411
  │ ├── jpeg_chroma_dc_huff(data: typing.Any, reverse: bool) -> typing.Any
359
412
  │ ├── jpeg_dct8x8(block: typing.Union[list, tuple], reverse: bool) -> list
360
- │ ├── jpeg_decode_pixels(scan_data: bytes, lqtable: list, cqtable: list, width: int, height: int) -> list
361
- │ ├── jpeg_encode_pixels(pixels: typing.Union[list, tuple], quality: int) -> tuple
413
+ │ ├── jpeg_decode_pixels(scan_data: bytes, q_tables: dict, huff_tables: dict, width: int, height: int, yh: int, yv: int, comp_ids: list, comp_info: dict, comp_huff: dict, rst_offsets: list) -> list
414
+ │ ├── jpeg_decode_progressive_pixels(scans_info: Any, q_tables: Any, huff_tables: Any, width: Any, height: Any, yh: Any, yv: Any, comp_ids: Any, comp_info: Any, comp_huff: Any) -> Any
415
+ │ ├── jpeg_encode_pixels(pixels: typing.Union[list, tuple], quality: int, subsampling: str) -> tuple
416
+ │ ├── jpeg_encode_progressive_pixels(pixels: Any, quality: Any, subsampling: Any) -> Any
362
417
  │ ├── jpeg_luma_dc_huff(data: typing.Any, reverse: bool) -> typing.Any
363
418
  │ ├── jpeg_rle_decoding(sequence: typing.Union[list, tuple]) -> list
364
419
  │ ├── jpeg_rle_encoding(sequence: typing.Union[list, tuple]) -> list
365
420
  │ ├── jpeg_split_pixels(matrix: list) -> list
366
421
  │ ├── jpeg_zigzag(data: typing.Union[list, tuple], reverse: bool) -> list
422
+ │ ├── octree_quantize(pixels: Any, num_colors: Any) -> Any
367
423
  │ ├── png_apply_filter(pixels: list, above_pixels: list, filter_type: int) -> list
368
424
  │ ├── png_reverse_filter(pixels: list, above_pixels: list, filter_type: int) -> list
369
425
  │ ├── rgb2ycbcr(weights: typing.Union[list, tuple]) -> tuple
@@ -439,7 +495,6 @@ PyPyNum
439
495
  │ ├── atan(x: typing.Union[int, float]) -> typing.Union[int, float]
440
496
  │ ├── atanh(x: typing.Union[int, float]) -> typing.Union[int, float]
441
497
  │ ├── average(data: typing.Union[list, tuple], weights: typing.Union[list, tuple]) -> float
442
- │ ├── beta(p: typing.Union[int, float], q: typing.Union[int, float]) -> typing.Union[int, float]
443
498
  │ ├── central_moment(data: typing.Union[list, tuple], order: int) -> float
444
499
  │ ├── coeff_det(x: typing.Union[list, tuple], y: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
445
500
  │ ├── combination(n: int, r: int) -> int
@@ -459,9 +514,7 @@ PyPyNum
459
514
  │ ├── erf(x: typing.Union[int, float]) -> float
460
515
  │ ├── exgcd(a: int, b: int) -> tuple
461
516
  │ ├── exp(x: typing.Union[int, float]) -> typing.Union[int, float]
462
- │ ├── factorial(n: int) -> int
463
517
  │ ├── freq(data: typing.Union[list, tuple]) -> dict
464
- │ ├── gamma(alpha: typing.Union[int, float]) -> float
465
518
  │ ├── gcd(args: int) -> int
466
519
  │ ├── geom_mean(numbers: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
467
520
  │ ├── harm_mean(numbers: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
@@ -572,13 +625,11 @@ PyPyNum
572
625
  │ └── words2int(words: str) -> int
573
626
  ├── plotting
574
627
  │ ├── CLASS
628
+ │ │ └── Canvas(object)/__init__(self: Any, xlim: tuple, ylim: tuple, resolution: typing.Union[int, float], aspect_ratio: typing.Union[int, float]) -> Any
575
629
  │ └── FUNCTION
576
- │ ├── background(right: typing.Union[int, float], left: typing.Union[int, float], top: typing.Union[int, float], bottom: typing.Union[int, float], complexity: typing.Union[int, float], ratio: typing.Union[int, float], string: bool) -> typing.Union[list, str]
577
- │ ├── binary(function: Any, right: typing.Union[int, float], left: typing.Union[int, float], top: typing.Union[int, float], bottom: typing.Union[int, float], complexity: typing.Union[int, float], ratio: typing.Union[int, float], error: Any, compare: Any, string: bool, basic: list, character: str, data: bool, coloration: Any) -> typing.Union[list, str]
578
- │ ├── c_unary(function: Any, projection: str, right: typing.Union[int, float], left: typing.Union[int, float], top: typing.Union[int, float], bottom: typing.Union[int, float], complexity: typing.Union[int, float], ratio: typing.Union[int, float], string: bool, basic: list, character: str, data: bool, coloration: Any) -> typing.Union[list, str]
579
- │ ├── change(data: typing.Union[list, str]) -> typing.Union[list, str]
580
630
  │ ├── colortext(text: str, rgb: typing.Union[list, tuple]) -> str
581
- └── unary(function: Any, right: typing.Union[int, float], left: typing.Union[int, float], top: typing.Union[int, float], bottom: typing.Union[int, float], complexity: typing.Union[int, float], ratio: typing.Union[int, float], string: bool, basic: list, character: str, data: bool, coloration: Any) -> typing.Union[list, str]
631
+ ├── estimate_lipschitz(func: Any, domain: Any, threshold: Any, n: Any, safety: Any) -> Any
632
+ │ └── safe_eval(func: Any, x: Any, y: Any, threshold: Any) -> Any
582
633
  ├── polys
583
634
  │ ├── CLASS
584
635
  │ │ └── Polynomial(object)/__init__(self: Any, terms: Any) -> Any
@@ -737,22 +788,40 @@ PyPyNum
737
788
  ├── ufuncs
738
789
  │ ├── CLASS
739
790
  │ └── FUNCTION
791
+ │ ├── _beta_scalar(a: Any, b: Any) -> Any
792
+ │ ├── _binomial_scalar(n: Any, k: Any) -> Any
793
+ │ ├── _factorial_scalar(n: Any) -> Any
794
+ │ ├── _lanczos_sum(z: Any) -> Any
795
+ │ ├── _log_sin_pi(z: Any) -> Any
796
+ │ ├── _logbeta_scalar(a: Any, b: Any) -> Any
797
+ │ ├── _logfactorial_scalar(n: Any) -> Any
798
+ │ ├── _pochhammer_scalar(a: Any, n: Any) -> Any
799
+ │ ├── _scalar_gamma(z: Any) -> Any
800
+ │ ├── _scalar_loggamma(z: Any) -> Any
740
801
  │ ├── add(x: Any, y: Any) -> Any
741
- │ ├── apply(a: Any, func: Any, rtype: Any) -> Any
742
- │ ├── base_ufunc(arrays: Any, func: Any, args: Any, rtype: Any) -> Any
802
+ │ ├── apply(a: Any, func: Any, rtype: Any, dtype: Any) -> Any
803
+ │ ├── base_ufunc(arrays: Any, func: Any, args: Any, rtype: Any, dtype: Any) -> Any
804
+ │ ├── beta(a: Any, b: Any) -> Any
805
+ │ ├── binomial(n: Any, k: Any) -> Any
743
806
  │ ├── divide(x: Any, y: Any) -> Any
744
807
  │ ├── equal(x: Any, y: Any) -> Any
808
+ │ ├── factorial(n: Any) -> Any
745
809
  │ ├── floor_divide(x: Any, y: Any) -> Any
810
+ │ ├── gamma(z: Any) -> Any
746
811
  │ ├── greater_equal(x: Any, y: Any) -> Any
747
812
  │ ├── greater_than(x: Any, y: Any) -> Any
748
813
  │ ├── less_equal(x: Any, y: Any) -> Any
749
814
  │ ├── less_than(x: Any, y: Any) -> Any
815
+ │ ├── logbeta(a: Any, b: Any) -> Any
816
+ │ ├── logfactorial(n: Any) -> Any
817
+ │ ├── loggamma(z: Any) -> Any
750
818
  │ ├── modulo(x: Any, y: Any) -> Any
751
819
  │ ├── multiply(x: Any, y: Any) -> Any
752
820
  │ ├── not_equal(x: Any, y: Any) -> Any
821
+ │ ├── pochhammer(a: Any, n: Any) -> Any
753
822
  │ ├── power(x: Any, y: Any, m: Any) -> Any
754
823
  │ ├── subtract(x: Any, y: Any) -> Any
755
- │ └── ufunc_helper(x: Any, y: Any, func: Any) -> Any
824
+ │ └── ufunc_helper(x: Any, y: Any, func: Any, rtype: Any, dtype: Any) -> Any
756
825
  ├── utils
757
826
  │ ├── CLASS
758
827
  │ │ ├── InfIterator(object)/__init__(self: Any, start: typing.Union[int, float, complex], mode: str, common: typing.Union[int, float, complex]) -> Any
@@ -770,156 +839,13 @@ PyPyNum
770
839
  └── zh_cn
771
840
  ├── CLASS
772
841
  └── FUNCTION
773
- ├── Fraction转为Decimal(分数对象: fractions.Fraction, 有效位数: int) -> decimal.Decimal
774
- ├── RC4伪随机生成算法(密钥序列: list) -> Any
775
- ├── RC4初始化密钥调度算法(密钥: bytes) -> list
776
- ├── RC4密码(文本: bytes, 密钥: bytes) -> bytes
777
- ├── ROT13密码(文本: str) -> str
778
- ├── S型函数(x: typing.Union[int, float]) -> typing.Union[int, float]
779
- ├── base64密码(文本: str, 解密: bool) -> str
780
- ├── x对数y乘积(x: float, y: float) -> float
781
- ├── y次方根(被开方数: typing.Union[int, float, complex], 开方数: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
782
- ├── 一维傅里叶变换(数据: Any) -> pypynum.fft.FT1D
783
- ├── 上伽玛(s: typing.Union[int, float, complex], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
784
- ├── 上标转整数(上标字符串: str) -> str
785
- ├── 下伽玛(s: typing.Union[int, float, complex], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
786
- ├── 下标转整数(下标字符串: str) -> str
787
- ├── 中位数(数据: typing.List[float]) -> float
788
- ├── 中国剩余定理(n: typing.List[int], a: typing.List[int]) -> int
789
- ├── 中心矩(数据: typing.List[float], 阶数: int) -> float
790
- ├── 乘积和(多个数组: typing.List[typing.Any]) -> float
791
- ├── 代替密码(文本: str, 替换映射: dict, 解密: bool) -> str
792
- ├── 众数(数据: typing.List[typing.Any]) -> Any
793
- ├── 伽玛函数(alpha: float) -> float
794
- ├── 余切(x: typing.Union[int, float]) -> typing.Union[int, float]
795
- ├── 余割(x: typing.Union[int, float]) -> typing.Union[int, float]
796
- ├── 余弦(x: typing.Union[int, float]) -> typing.Union[int, float]
797
- ├── 偏度(数据: typing.List[float]) -> float
798
- ├── 全一(形状: Any, 返回类型: Any) -> Any
799
- ├── 全部填充(形状: Any, 填充值: Any, 返回类型: Any) -> Any
800
- ├── 全零(形状: Any, 返回类型: Any) -> Any
801
- ├── 写入(文件: str, 对象: object) -> Any
802
- ├── 几何平均数(数据: typing.List[float]) -> float
803
- ├── 凯撒密码(文本: str, 移位: int, 解密: bool) -> str
804
- ├── 分位数(数据: list, 分位值: float, 插值方法: str, 已排序: bool) -> float
805
- ├── 判定系数(x: typing.List[float], y: typing.List[float]) -> float
806
- ├── 判断平方数(n: int) -> bool
807
- ├── 加权平均(数据: typing.List[float], 权重: typing.List[float]) -> float
808
- ├── 协方差(x: typing.List[float], y: typing.List[float], 自由度: int) -> float
809
- ├── 原根(a: int, 单个: bool) -> typing.Union[int, typing.List[int]]
810
- ├── 原点矩(数据: typing.List[float], 阶数: int) -> float
811
- ├── 双曲余切(x: typing.Union[int, float]) -> typing.Union[int, float]
812
- ├── 双曲余割(x: typing.Union[int, float]) -> typing.Union[int, float]
813
- ├── 双曲余弦(x: typing.Union[int, float]) -> typing.Union[int, float]
814
- ├── 双曲正切(x: typing.Union[int, float]) -> typing.Union[int, float]
815
- ├── 双曲正割(x: typing.Union[int, float]) -> typing.Union[int, float]
816
- ├── 双曲正弦(x: typing.Union[int, float]) -> typing.Union[int, float]
817
- ├── 反余切(x: typing.Union[int, float]) -> typing.Union[int, float]
818
- ├── 反余割(x: typing.Union[int, float]) -> typing.Union[int, float]
819
- ├── 反余弦(x: typing.Union[int, float]) -> typing.Union[int, float]
820
- ├── 反双曲余切(x: typing.Union[int, float]) -> typing.Union[int, float]
821
- ├── 反双曲余割(x: typing.Union[int, float]) -> typing.Union[int, float]
822
- ├── 反双曲余弦(x: typing.Union[int, float]) -> typing.Union[int, float]
823
- ├── 反双曲正切(x: typing.Union[int, float]) -> typing.Union[int, float]
824
- ├── 反双曲正割(x: typing.Union[int, float]) -> typing.Union[int, float]
825
- ├── 反双曲正弦(x: typing.Union[int, float]) -> typing.Union[int, float]
826
- ├── 反正切(x: typing.Union[int, float]) -> typing.Union[int, float]
827
- ├── 反正割(x: typing.Union[int, float]) -> typing.Union[int, float]
828
- ├── 反正弦(x: typing.Union[int, float]) -> typing.Union[int, float]
829
- ├── 可能是平方数(n: int) -> bool
830
- ├── 填充序列(形状: Any, 序列: Any, 重复: Any, 填充: Any, 返回类型: Any) -> Any
831
- ├── 多次方根取整(被开方数: int, 开方数: int) -> int
832
- ├── 多精度余弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
833
- ├── 多精度双曲余弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
834
- ├── 多精度双曲正弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
835
- ├── 多精度反余弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
836
- ├── 多精度反正切(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
837
- ├── 多精度反正弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
838
- ├── 多精度圆周率(有效位数: int, 方法: str) -> decimal.Decimal
839
- ├── 多精度复数(实部: typing.Union[int, float, str, decimal.Decimal], 虚部: typing.Union[int, float, str, decimal.Decimal], 有效位数: int) -> pypynum.multiprec.MPComplex
840
- ├── 多精度对数(真数: typing.Union[int, float], 底数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
841
- ├── 多精度方位角(y: typing.Union[int, float], x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
842
- ├── 多精度欧拉伽马(有效位数: int) -> decimal.Decimal
843
- ├── 多精度正弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
844
- ├── 多精度自然对数(真数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
845
- ├── 多精度自然常数(有效位数: int, 方法: str) -> decimal.Decimal
846
- ├── 多精度自然指数(指数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
847
- ├── 多精度菲涅耳余弦积分(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
848
- ├── 多精度菲涅耳正弦积分(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
849
- ├── 多精度黄金分割率(有效位数: int, 方法: str) -> decimal.Decimal
850
- ├── 多项式方程(系数: list) -> list
851
- ├── 字符串转整数(字符串: str) -> int
852
- ├── 导数(函数: Any, 参数: float, 步长: float, 额外参数: Any, 额外关键字参数: Any) -> float
853
- ├── 峰度(数据: typing.List[float], 费希尔: bool) -> float
854
- ├── 希尔256密码(文本: bytes, 密钥: list, 解密: bool) -> bytes
855
- ├── 平均数(数据: typing.List[float]) -> float
856
- ├── 平方平均数(数据: typing.List[float]) -> float
857
- ├── 平方根取整(被开方数: int) -> int
858
- ├── 序列滚动(序列: typing.Iterator[typing.Any], 偏移: int) -> typing.Iterator[typing.Any]
859
- ├── 归一化(数据: typing.List[float], 目标: float) -> typing.List[float]
860
- ├── 扩展欧几里得算法(a: int, b: int) -> typing.Tuple[int, int, int]
861
- ├── 排列数(总数: int, 选取数: int) -> int
862
- ├── 数组(数据: list, 检查: bool) -> pypynum.arrays.Array
863
- ├── 整数转上标(标准字符串: str) -> str
864
- ├── 整数转下标(标准字符串: str) -> str
865
- ├── 整数转单词(整数: int) -> str
866
- ├── 整数转罗马数(整数: int, 上划线: bool) -> str
867
- ├── 方差(数据: typing.List[float], 自由度: int) -> float
868
- ├── 普莱费尔密码(文本: str, 密钥: str, 解密: bool) -> str
869
- ├── 最大公约数(args: int) -> int
870
- ├── 最小公倍数(args: int) -> int
871
- ├── 极差(数据: typing.List[float]) -> float
872
- ├── 标准差(数据: typing.List[float], 自由度: int) -> float
873
- ├── 模运算阶(a: int, n: int, b: int) -> int
874
- ├── 欧拉函数(n: int) -> int
875
- ├── 正切(x: typing.Union[int, float]) -> typing.Union[int, float]
876
- ├── 正割(x: typing.Union[int, float]) -> typing.Union[int, float]
877
- ├── 正弦(x: typing.Union[int, float]) -> typing.Union[int, float]
878
- ├── 浮点数转分数(数值: float, 是否带分数: bool, 误差: float) -> tuple
879
- ├── 相关系数(x: typing.List[float], y: typing.List[float]) -> float
880
- ├── 积分(函数: Any, 积分开始: float, 积分结束: float, 积分点数: int, 额外参数: Any, 额外关键字参数: Any) -> float
881
- ├── 积累乘积(数据: typing.List[float]) -> float
882
- ├── 符号函数(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
883
- ├── 类似形状全一(数组A: Any, 返回类型: Any) -> Any
884
- ├── 类似形状全零(数组A: Any, 返回类型: Any) -> Any
885
- ├── 类似形状填充(数组A: Any, 填充值: Any, 返回类型: Any) -> Any
886
- ├── 累乘积(序列: typing.List[float]) -> typing.List[float]
887
- ├── 累加和(序列: typing.List[float]) -> typing.List[float]
888
- ├── 线性方程组(左边: list, 右边: list) -> list
889
- ├── 组合数(总数: int, 选取数: int) -> int
890
- ├── 维吉尼亚密码(文本: str, 密钥: str, 解密: bool) -> str
891
- ├── 罗马数转整数(罗马数: str) -> int
892
- ├── 自然对数(真数: typing.Union[int, float]) -> typing.Union[int, float]
893
- ├── 自然指数(指数: typing.Union[int, float]) -> typing.Union[int, float]
894
- ├── 莫尔斯密码(文本: str, 解密: bool) -> str
895
- ├── 解析浮点数字符串(字符串: str) -> tuple
896
- ├── 误差函数(x: typing.Union[int, float]) -> typing.Union[int, float]
897
- ├── 读取(文件: str) -> list
898
- ├── 调和平均数(数据: typing.List[float]) -> float
899
- ├── 贝塔函数(p: float, q: float) -> float
900
- ├── 贝塞尔函数I0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
901
- ├── 贝塞尔函数I1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
902
- ├── 贝塞尔函数Iv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
903
- ├── 贝塞尔函数J0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
904
- ├── 贝塞尔函数J1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
905
- ├── 贝塞尔函数Jv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
906
- ├── 负一整数次幂(指数: int) -> int
907
- ├── 转为多精度复数(实部: typing.Union[int, float, str, decimal.Decimal, complex, pypynum.multiprec.MPComplex], 虚部: typing.Union[int, float, str, decimal.Decimal], 有效位数: int) -> pypynum.multiprec.MPComplex
908
- ├── 转换为列表(数据: Any) -> list
909
- ├── 转换为数组(数据: Any) -> pypynum.arrays.Array
910
- ├── 连续乘积(下界: int, 上界: int, 函数: typing.Callable) -> float
911
- ├── 连续加和(下界: int, 上界: int, 函数: typing.Callable) -> float
912
- ├── 阶乘函数(n: int) -> int
913
- ├── 阿特巴什密码(文本: str) -> str
914
- ├── 频率统计(数据: typing.List[typing.Any]) -> typing.Dict[typing.Any, int]
915
- └── 黎曼函数(alpha: float) -> float
916
842
  ```
917
843
 
918
844
  ### Code Testing
919
845
 
920
846
  ```python
921
- from pypynum import (arrays, geoms, hypcmpnms, logics, matrices, multiprec, special, vectors,
922
- ciphers, consts, equations, maths, plotting, random, regs, tools)
847
+ from pypynum import (arrays, geoms, hypcmpnms, logics, matrices, multiprec, polys, special, vectors, ciphers, consts,
848
+ equations, maths, plotting, random, regs, tools, ufuncs)
923
849
 
924
850
  ...
925
851
 
@@ -1035,6 +961,32 @@ Logarithm of 2 (base 10): 0.30102999566398119521373889472449302676818988146211
1035
961
  Value of exp(e^2): 1618.1779919126535017
1036
962
  """
1037
963
 
964
+ p0 = polys.poly([(2, 1), (1, -2), (0, 1)])
965
+ p1 = polys.poly([(1, 1), (0, -1)])
966
+ print(p0)
967
+ print(p1)
968
+ print(p0 + p1)
969
+ print(p0 * p1)
970
+ print(p0.deriv())
971
+ print(p0.integ())
972
+ print(p0.roots())
973
+ print(p0.gcd(p1))
974
+ print(polys.legpoly(3))
975
+ print(polys.chebpoly(3))
976
+
977
+ """
978
+ 1 - 2x + x^2
979
+ -1 + x
980
+ -x + x^2
981
+ -1 + 3x - 3x^2 + x^3
982
+ -2 + 2x
983
+ x - x^2 + 0.3333333333333333x^3
984
+ [0.9999999999999998, 0.9999999999999999]
985
+ -1 + x
986
+ -1.5x + 2.5x^3
987
+ -3x + 4x^3
988
+ """
989
+
1038
990
  print("Bessel Function of the first kind, order 0 at x=1:", special.besselj0(1))
1039
991
  print("Modified Bessel function of the first kind, order 1 at x=1:", special.besseli1(1))
1040
992
  print("Hypergeometric function 0F1 at z=0.5 with b0=1:", special.hyp0f1(1, 0.5))
@@ -1125,11 +1077,11 @@ print(equations.lin_eq(*m))
1125
1077
 
1126
1078
  """
1127
1079
  [(-1.5615528128088307-3.728101026218476e-24j), (1.0000000000000007+3.2415545137443745e-25j), (2.5615528128088294+7.352235277305158e-24j)]
1128
- [1.6666666666666665, -0.6666666666666666, -0.4444444444444444]
1080
+ [ 1.6666666666666665 -0.6666666666666666 -0.4444444444444444]
1129
1081
  """
1130
1082
 
1131
1083
  print(maths.cot(consts.pi / 3))
1132
- print(maths.gamma(1.5))
1084
+ print(maths.combination(10, 3))
1133
1085
  print(maths.pi(1, 10, lambda x: x ** 2))
1134
1086
  print(maths.product([2, 3, 5, 7, 11, 13, 17, 19, 23, 29]))
1135
1087
  print(maths.sigma(1, 10, lambda x: x ** 2))
@@ -1137,86 +1089,108 @@ print(maths.var([2, 3, 5, 7, 11, 13, 17, 19, 23, 29]))
1137
1089
 
1138
1090
  """
1139
1091
  0.577350269189626
1140
- 0.886226925452758
1092
+ 120
1141
1093
  13168189440000
1142
1094
  6469693230
1143
1095
  385
1144
1096
  73.29
1145
1097
  """
1146
1098
 
1147
- plt = plotting.unary(lambda x: x ** 2, top=10, bottom=0, character="+")
1148
- print(plt)
1149
- print(plotting.binary(lambda x, y: x ** 2 + y ** 2 - 10, right=10, left=0, compare="<=", basic=plotting.change(plt)))
1150
- print(plotting.c_unary(lambda x: x ** x, right=2, left=-2, top=2, bottom=-2, complexity=20, character="-"))
1099
+ print("Scalar gamma(5):", ufuncs.gamma(5))
1100
+ print("Complex gamma(1+1j):", ufuncs.gamma(1 + 1j))
1101
+ print("Array gamma:", ufuncs.gamma(arrays.array([1, 2, 3, 4, 5])))
1102
+ print("Scalar factorial(10):", ufuncs.factorial(10))
1103
+ print("Array factorial:", ufuncs.factorial(arrays.array([1, 2, 3, 4, 5])))
1104
+ print("Scalar binomial(10, 3):", ufuncs.binomial(10, 3))
1105
+ print("Complex binomial(5+1j, 2+1j):", ufuncs.binomial(5 + 1j, 2 + 1j))
1106
+ print("Array binomial:", ufuncs.binomial(arrays.array([5, 6, 7]), arrays.array([2, 3, 4])))
1107
+ print("Scalar beta(2, 3):", ufuncs.beta(2, 3))
1108
+ print("Complex beta(1+1j, 2+1j):", ufuncs.beta(1 + 1j, 2 + 1j))
1109
+ print("Scalar pochhammer(2, 3):", ufuncs.pochhammer(2, 3))
1110
+ print("Array loggamma:", ufuncs.loggamma(arrays.array([2, 3, 4, 5])))
1151
1111
 
1152
1112
  """
1153
- 1.00e+01| + +
1113
+ Scalar gamma(5): 24.0
1114
+ Complex gamma(1+1j): (0.49801566811835757-0.15494982830181106j)
1115
+ Array gamma: [ 1.0 1.0 2.0 6.0 24.0]
1116
+ Scalar factorial(10): 3628800.0
1117
+ Array factorial: [ 1.0 2.0 6.0 24.0 120.0]
1118
+ Scalar binomial(10, 3): 119.99999999999987
1119
+ Complex binomial(5+1j, 2+1j): (7.999999999999997+7.6666666666666625j)
1120
+ Array binomial: [10.000000000000002 20.000000000000007 35.00000000000001]
1121
+ Scalar beta(2, 3): 0.08333333333333337
1122
+ Complex beta(1+1j, 2+1j): (-0.10563618646826745-0.3827641582689022j)
1123
+ Scalar pochhammer(2, 3): 24.0
1124
+ Array loggamma: [ 0.0 0.693147180559945 1.7917594692280554 3.178053830347945]
1125
+ """
1126
+
1127
+ canvas = plotting.Canvas(xlim=(0, 10), ylim=(0, 10), resolution=50)
1128
+ canvas.plot(lambda x: x ** 2, marker="+")
1129
+ print(canvas.render())
1130
+ canvas2 = plotting.Canvas(xlim=(-5, 5), ylim=(-5, 5), resolution=60)
1131
+ canvas2.plot_contour(lambda x, y: maths.sin(x ** 2) + maths.sin(y ** 2), threshold=0, marker="*")
1132
+ print(canvas2.render())
1133
+ canvas3 = plotting.Canvas(xlim=(-2, 2), ylim=(-2, 2), resolution=40)
1134
+ canvas3.plot_complex(lambda z: z ** z, marker="-")
1135
+ print(canvas3.render())
1136
+
1137
+ """
1138
+ 1.00e+01| +
1154
1139
  |
1155
- | + +
1140
+ | +
1156
1141
  |
1157
- | + +
1158
- | + +
1142
+ | +
1159
1143
  |
1160
- | + +
1144
+ | +
1145
+ | +
1161
1146
  5.00e+00|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
1162
- | + +
1163
- | + +
1164
- | + +
1165
- | + +
1166
- | + +
1167
- | + +
1168
- | + +
1169
- | +++ +++
1170
- 0.00e+00|________________________+++________________________
1171
- -5.00e+00 0.00e+00 5.00e+00
1172
- 1.00e+01| + +
1173
- |
1174
- | + +
1147
+ | +
1148
+ | +
1149
+ | +
1175
1150
  |
1176
- |......... + +
1177
- |............. +
1178
- |..............
1179
- |................ +
1180
- 5.00e+00|................_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
1181
- |................ +
1182
- |................ +
1183
- |.............. + +
1184
- |............. + +
1185
- |......... + +
1186
- | + +
1187
- | + +
1188
- | +++ +++
1189
- 0.00e+00|________________________+++________________________
1190
- -5.00e+00 0.00e+00 5.00e+00
1191
- 2.00e+00| - - - - - -
1192
- | - - - - - - -
1193
- | - - - - - -
1194
- |- - - - - - -
1195
- | - - - - -- - - - -
1196
- | - - - - - - - - -
1197
- | - - - - -- - --- -- - -- - - - - -
1198
- | - - - -- -- - - - -- - - -
1199
- | - - - - - - - -- - --- --- - - --- -- - -
1200
- | - - - - - -- ----- -- -- --- -- -- --- -- - -
1201
- | - - - ------------ ---- - -- -- - --- - - -
1202
- | - - - - - ----- - -- ----------------------- -- ---- - -- --
1203
- | - - - - - ---- --------------------------------- - - - - - -
1204
- 0.00e+00|_ _ _ _ _ _ _ _-_-_-_-_---- ------------------------------------_-- _ _ _ _ _ _ _
1205
- | - - - - ----------------------------------------- -- - - - -
1206
- | - -- - - -- - - --------------------------------- - - -
1207
- | - - ---- - - -- --------------------- ----- ---- - -- -
1208
- | - - -- --------- -- -- - ----- --- -- - - - -
1209
- | - - - - - - - ---- --- --- --- -- -- --- - - -
1210
- | - - - - - -- -- -- - - -- -- --
1211
- | - - - -- - -- -- - - -- - -
1212
- | - - - - - - - -- - - -- - -
1213
- | - - - - -- -- - - - - -
1214
- | - - - - - - - -
1215
- |- - - - - - - -
1216
- | - - - - - -
1217
- | - - - - -
1218
- -2.00e+00|___________-_________________-___________-_____________________-____________-____
1219
- -2.00e+00 0.00e+00 2.00e+00
1151
+ | +
1152
+ | +
1153
+ | ++
1154
+ | ++
1155
+ 0.00e+00|+++________________________________________________
1156
+ 0.00e+00 5.00e+00 1.00e+01
1157
+ 5.00e+00| *** **** **** ********* ********* **** **** ***
1158
+ |************* ******** *********** ******** *************
1159
+ |*************************************************************
1160
+ |*************************************************************
1161
+ |********************** ************* **********************
1162
+ |*************************************************************
1163
+ | *** **** **** *********************** **** **** ***
1164
+ |*** *** **** ***** ***** **** *** ***
1165
+ |** *** *** *** *** *** *** **
1166
+ |*** * * * ** ** ** ** ** ** * * * ***
1167
+ 0.00e+00|_ * * * _*_ * _*_ _*_ _ _ _ _ * _ _ _ _ _*_ _*_ * _*_ * * * _
1168
+ |*** * * * ** ** ** ** ** ** * * * ***
1169
+ |** *** *** *** *** *** *** **
1170
+ |*** *** **** ***** ***** **** *** ***
1171
+ | *** **** **** *********************** **** **** ***
1172
+ |*************************************************************
1173
+ |********************** ************* **********************
1174
+ |*************************************************************
1175
+ |*************************************************************
1176
+ |************* ******** *********** ******** *************
1177
+ -5.00e+00|__***_****__****____*********___*********____****__****_***__
1178
+ -5.00e+00 0.00e+00 5.00e+00
1179
+ 2.00e+00| - -
1180
+ |- - - -
1181
+ | - - -- - - -
1182
+ | - - -- - -
1183
+ | - ---- ---- -- --
1184
+ | - ---- ------------- ---- - -
1185
+ 0.00e+00|_ _-_ _ _ _-_-------------------- - _ _ _
1186
+ | - - -------------------- -
1187
+ | - ---- ------------- ---- - -
1188
+ | - ---- ---- -- --
1189
+ | - - -- - -
1190
+ | - - -- - - -
1191
+ |- - - -
1192
+ -2.00e+00|________________-___________-____________
1193
+ -2.00e+00 - 0.00e+00 - 2.00e+00
1220
1194
  """
1221
1195
 
1222
1196
  print(random.gauss(0, 1, [2, 3, 4]))
@@ -1225,10 +1199,10 @@ print(random.randint(0, 9, [2, 3, 4]))
1225
1199
  print(random.uniform(0, 9, [2, 3, 4]))
1226
1200
 
1227
1201
  """
1228
- [[[0.18059388030329554, -0.7950286594701896, -1.6124456807502878, 1.0650032690802622], [1.231592625021916, -0.2923569307790834, 0.5743684840351643, -0.5994993318165575], [-0.4541501878112403, 0.5194701735167844, -0.41134655581914514, 2.5838345235765336]], [[-0.38027869224951916, 1.407233237769525, -1.4230691454968791, -1.098291804499891], [0.0720517812951513, 1.2716687933757764, -0.389868632414012, 0.18416602669163057], [-0.49978319823217315, 0.8789409340735714, -1.4538419291500941, -1.895514116697364]]]
1229
- [[[0.3214199347664204, 0.4682526051010606, 0.8691333897517276, 0.65768740769836], [0.7632355843244432, 0.5804412886619936, 0.008332295847854443, 0.6151292129754637], [0.9795343167986345, 0.5205461670247327, 0.7248923173697739, 0.11717223436961488]], [[0.7662005170926139, 0.9714376279553422, 0.9550672285743181, 0.08793525427569937], [0.6339393968200449, 0.8301210945735973, 0.6564657233275701, 0.6220565155685059], [0.21406744938064437, 0.3047415909582225, 0.6510510008125593, 0.12269523561892148]]]
1230
- [[[5, 1, 4, 9], [9, 1, 6, 2], [4, 3, 1, 9]], [[0, 9, 6, 9], [7, 8, 0, 2], [9, 8, 5, 3]]]
1231
- [[[1.6943948141992893, 2.247908784078809, 8.414928873268128, 4.628393016930337], [7.572639917918929, 5.357050653981085, 8.240417270343459, 3.24879148260883], [4.771181663822661, 1.905700180078211, 3.7868896315863747, 4.2241419541638265]], [[4.635584514037156, 7.401849961502754, 0.6758543569780475, 6.101106332926675], [1.9978290038252968, 7.441511948419005, 0.10317848285562836, 5.723737686439019], [0.13415224754500865, 7.69176143777073, 2.9628506743472967, 5.077060383033804]]]
1202
+ [[[-0.1298501384051712, 0.3727699801277098, 0.4166700916648799, -0.7775206291555409], [-0.30014656405123064, -0.16697588134574046, 0.05882136579879377, -1.3702698211987647], [0.6197659045003135, 1.991697529996604, 0.9298444669920536, 0.4422044574065226]], [[-1.0421887750231207, 1.0127464645610977, -0.19182259386341258, -0.005000095322641637], [-0.9920550978825892, -0.10153125400742637, -0.10261269275330637, 0.14806319544548724], [-0.4828220202617309, -1.1860880232637627, -2.0699004045058267, -0.529540752082409]]]
1203
+ [[[0.08655140967833264, 0.6394780807323993, 0.2524438881598683, 0.6474199226773842], [0.5756049932474537, 0.5282380647601147, 0.7316894682109464, 0.019931361163881167], [0.7159100626981946, 0.9890997667800252, 0.07139958022635717, 0.41108364623335725]], [[0.3968800554375378, 0.2991796674738614, 0.6018719095232256, 0.8784654982369239], [0.4686461866479704, 0.590160413315007, 0.8152095317051954, 0.27473954566778025], [0.4442862079226716, 0.9497328028804668, 0.024900765451991935, 0.6874120115820541]]]
1204
+ [[[1, 2, 1, 8], [7, 5, 6, 4], [7, 2, 0, 3]], [[4, 7, 5, 9], [6, 5, 7, 7], [9, 7, 9, 7]]]
1205
+ [[[8.03159946997718, 0.6986351746766797, 6.257222546262797, 0.201624984908367], [1.5010606332093606, 8.490949276137348, 2.801498207055703, 1.6336744885080783], [3.940481233427212, 7.308098296419055, 2.025878540098897, 8.64457791957968]], [[6.154491182321485, 0.7269750156678364, 2.5524453548150046, 0.9963287593978754], [7.233834593868724, 8.238488157751819, 5.011182865628198, 1.7274625227896652], [2.378375506221915, 7.213742910935083, 2.705310847444149, 6.1706150877584705]]]
1232
1206
  """
1233
1207
 
1234
1208
  print(regs.lin_reg(list(range(5)), [2, 4, 6, 7, 8]))
@@ -1253,8 +1227,8 @@ print(tools.linspace(0, 2.8, 8))
1253
1227
  [0.0, 0.39999999999999997, 0.7999999999999999, 1.2, 1.5999999999999999, 1.9999999999999998, 2.4, 2.8]
1254
1228
  """
1255
1229
 
1256
- # Tip:
1257
- # The test has been successfully passed and ended.
1258
- # These tests are only part of the functionality of this package.
1259
- # More features need to be explored and tried by yourself!
1230
+ # Tip:
1231
+ # The test has been successfully passed and ended.
1232
+ # These tests are only part of the functionality of this package.
1233
+ # More features need to be explored and tried by yourself!
1260
1234
  ```