PyPyNum 1.17.2__py3-none-any.whl → 1.18.1__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/README.md +95 -113
- pypynum/__init__.py +5 -5
- pypynum/arrays.py +110 -40
- pypynum/ciphers.py +12 -15
- pypynum/dists.py +155 -174
- pypynum/geoms.py +306 -83
- pypynum/groups.py +116 -64
- pypynum/huffman +1 -0
- pypynum/hypcmpnms.py +59 -0
- pypynum/images.py +698 -92
- pypynum/kernels.py +96 -0
- pypynum/maths.py +20 -14
- pypynum/matrices.py +130 -104
- pypynum/networks.py +2 -2
- pypynum/numbers.py +191 -48
- pypynum/plotting.py +2 -2
- pypynum/seqs.py +6 -1
- pypynum/special.py +34 -0
- pypynum/symbols.py +273 -46
- pypynum/trees.py +4 -3
- pypynum/types.py +1 -1
- pypynum/ufuncs.py +19 -40
- pypynum/utils.py +44 -69
- pypynum/vectors.py +7 -7
- pypynum/zh_cn.py +0 -4
- {PyPyNum-1.17.2.dist-info → pypynum-1.18.1.dist-info}/METADATA +109 -779
- pypynum-1.18.1.dist-info/RECORD +50 -0
- {PyPyNum-1.17.2.dist-info → pypynum-1.18.1.dist-info}/WHEEL +1 -1
- PyPyNum-1.17.2.dist-info/RECORD +0 -49
- {PyPyNum-1.17.2.dist-info → pypynum-1.18.1.dist-info}/top_level.txt +0 -0
pypynum/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# PyPyNum
|
|
2
2
|
|
|
3
|
-
PyPyNum is a
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
PyPyNum is a versatile Python math lib. It features modules for math, data analysis, arrays, crypto, physics, RNG, data
|
|
4
|
+
proc, stats, eq solving, image proc, interp, matrix calc, and high-prec math. Designed for scientific computing, data
|
|
5
|
+
science, and ML, it offers efficient, general-purpose tools.
|
|
6
6
|
|
|
7
7
|
```
|
|
8
8
|
________ ___ ___ ________ ___ ___ ________ ___ ___ _____ ______
|
|
@@ -19,7 +19,7 @@ scientific computing, data science, and machine learning, PyPyNum provides effic
|
|
|
19
19
|
[](https://pepy.tech/project/pypynum)
|
|
20
20
|
[](https://pepy.tech/project/pypynum)
|
|
21
21
|
|
|
22
|
-
## Version -> 1.
|
|
22
|
+
## PyPyNum | Version -> 1.18.1 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
|
|
23
23
|
|
|
24
24
|

|
|
25
25
|
|
|
@@ -30,7 +30,7 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee or GitHub.
|
|
|
30
30
|
+ Multi functional math library, similar to numpy, scipy, etc., designed specifically for PyPy interpreters and also
|
|
31
31
|
supports other types of Python interpreters
|
|
32
32
|
+ Update versions periodically to add more practical features
|
|
33
|
-
+ If you need to contact, please add QQ number 2261748025 (
|
|
33
|
+
+ If you need to contact, please add QQ number 2261748025 (一只水晶兰), or through my email 2261748025@qq.com
|
|
34
34
|
|
|
35
35
|
```
|
|
36
36
|
+++++++++++++++++++++++++++++++++++++++++
|
|
@@ -148,57 +148,10 @@ Python interpreter and run it!
|
|
|
148
148
|
|
|
149
149
|
### Functional Changes Compared to the Previous Version
|
|
150
150
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
157
|
-
|
|
158
|
-
The pypynum.utils module has recently introduced a new class
|
|
159
|
-
called RadixInt. This class is designed to facilitate the
|
|
160
|
-
representation and manipulation of integers in various bases,
|
|
161
|
-
ranging from base 2 to base 36.
|
|
162
|
-
|
|
163
|
-
The RadixInt class within the pypynum.utils module provides a
|
|
164
|
-
robust way to work with integers in custom bases. It allows
|
|
165
|
-
users to initialize instances with either a decimal number or a
|
|
166
|
-
string representation of a number in the desired base. The class
|
|
167
|
-
supports conversion between different bases, as well as basic
|
|
168
|
-
arithmetic operations that can be performed on integers
|
|
169
|
-
represented in various bases.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
<<< The following are some usage examples >>>
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
from pypynum import RadixInt
|
|
176
|
-
|
|
177
|
-
# Base-2 and base-10 numbers
|
|
178
|
-
binary_num = RadixInt("1010", 2)
|
|
179
|
-
decimal_num = RadixInt(10, 10)
|
|
180
|
-
print(binary_num) # Output: (1010)_{2}
|
|
181
|
-
print(decimal_num) # Output: (10)_{10}
|
|
182
|
-
binary_to_octal = RadixInt("1010", 2).to_base(8)
|
|
183
|
-
print(binary_to_octal) # Output: (12)_{8}
|
|
184
|
-
# Addition
|
|
185
|
-
result_add = binary_num + decimal_num
|
|
186
|
-
print(result_add) # Output: (20)_{10}
|
|
187
|
-
# Base-8 and base-10 numbers
|
|
188
|
-
octal_num = RadixInt("123", 8)
|
|
189
|
-
decimal_num = RadixInt(5, 10)
|
|
190
|
-
# Subtraction
|
|
191
|
-
result_sub = octal_num - decimal_num
|
|
192
|
-
print(result_sub) # Output: (78)_{10}
|
|
193
|
-
# Base-16 and base-2 numbers
|
|
194
|
-
hex_num = RadixInt("1A", 16)
|
|
195
|
-
binary_num = RadixInt("11", 2)
|
|
196
|
-
# Multiplication
|
|
197
|
-
result_mul = hex_num * binary_num
|
|
198
|
-
print(result_mul) # Output: (78)_{10}
|
|
199
|
-
|
|
200
|
-
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
201
|
-
```
|
|
151
|
+
> 1. The `hypcmpnms` module added hypercomplex exponential and logarithmic operations.
|
|
152
|
+
> 2. The `dists` module fixed all calculation errors.
|
|
153
|
+
> 3. The `geoms` module fixed calculation errors and added more features.
|
|
154
|
+
> 4. The `utils` module fixed calculation errors in the `IntervalSet` class.
|
|
202
155
|
|
|
203
156
|
### Run Time Test
|
|
204
157
|
|
|
@@ -226,23 +179,23 @@ Python interpreter version
|
|
|
226
179
|
PyPyNum
|
|
227
180
|
├── arrays
|
|
228
181
|
│ ├── CLASS
|
|
229
|
-
│ │ ├── Array(object)/__init__(self: Any, data: Any, check: Any) -> Any
|
|
182
|
+
│ │ ├── Array(object)/__init__(self: Any, data: Any, check: Any, dtype: Any) -> Any
|
|
230
183
|
│ │ └── BoolArray(pypynum.arrays.Array)/__init__(self: Any, data: Any, check: Any) -> Any
|
|
231
184
|
│ └── FUNCTION
|
|
232
|
-
│ ├── array(data: Any) -> Any
|
|
233
|
-
│ ├── asarray(data: Any) -> Any
|
|
185
|
+
│ ├── array(data: Any, dtype: Any) -> Any
|
|
186
|
+
│ ├── asarray(data: Any, dtype: Any) -> Any
|
|
234
187
|
│ ├── aslist(data: Any) -> Any
|
|
235
188
|
│ ├── boolarray(data: Any) -> Any
|
|
236
|
-
│ ├── fill(shape: typing.
|
|
237
|
-
│ ├── full(shape: typing.
|
|
238
|
-
│ ├── full_like(a: typing.Any, fill_value: typing.Any, rtype: typing.Callable) -> typing.Any
|
|
189
|
+
│ ├── fill(shape: typing.Sequence, sequence: typing.Sequence, repeat: bool, pad: typing.Any, rtype: typing.Callable, dtype: type) -> typing.Any
|
|
190
|
+
│ ├── full(shape: typing.Sequence, fill_value: typing.Any, rtype: typing.Callable, dtype: type) -> typing.Any
|
|
191
|
+
│ ├── full_like(a: typing.Any, fill_value: typing.Any, rtype: typing.Callable, dtype: type) -> typing.Any
|
|
239
192
|
│ ├── get_shape(data: Any) -> Any
|
|
240
193
|
│ ├── is_valid_array(_array: Any, _shape: Any) -> Any
|
|
241
|
-
│ ├── ones(shape: typing.
|
|
242
|
-
│ ├── ones_like(a: typing.Any, rtype: typing.Callable) -> typing.Any
|
|
194
|
+
│ ├── ones(shape: typing.Sequence, rtype: typing.Callable, dtype: type) -> typing.Any
|
|
195
|
+
│ ├── ones_like(a: typing.Any, rtype: typing.Callable, dtype: type) -> typing.Any
|
|
243
196
|
│ ├── tensorproduct(tensors: pypynum.arrays.Array) -> pypynum.arrays.Array
|
|
244
|
-
│ ├── zeros(shape: typing.
|
|
245
|
-
│ └── zeros_like(a: typing.Any, rtype: typing.Callable) -> typing.Any
|
|
197
|
+
│ ├── zeros(shape: typing.Sequence, rtype: typing.Callable, dtype: type) -> typing.Any
|
|
198
|
+
│ └── zeros_like(a: typing.Any, rtype: typing.Callable, dtype: type) -> typing.Any
|
|
246
199
|
├── chars
|
|
247
200
|
│ ├── CLASS
|
|
248
201
|
│ └── FUNCTION
|
|
@@ -254,7 +207,7 @@ PyPyNum
|
|
|
254
207
|
│ ├── CLASS
|
|
255
208
|
│ └── FUNCTION
|
|
256
209
|
│ ├── atbash(text: str) -> str
|
|
257
|
-
│ ├── base_64(text:
|
|
210
|
+
│ ├── base_64(text: bytes, decrypt: bool) -> bytes
|
|
258
211
|
│ ├── caesar(text: str, shift: int, decrypt: bool) -> str
|
|
259
212
|
│ ├── hill256(text: bytes, key: list, decrypt: bool) -> bytes
|
|
260
213
|
│ ├── ksa(key: bytes) -> list
|
|
@@ -284,7 +237,7 @@ PyPyNum
|
|
|
284
237
|
├── dists
|
|
285
238
|
│ ├── CLASS
|
|
286
239
|
│ └── FUNCTION
|
|
287
|
-
│ ├── beta_pdf(x: Any,
|
|
240
|
+
│ ├── beta_pdf(x: Any, alpha: Any, beta: Any) -> Any
|
|
288
241
|
│ ├── binom_pmf(k: Any, n: Any, p: Any) -> Any
|
|
289
242
|
│ ├── cauchy_cdf(x: Any, x0: Any, gamma: Any) -> Any
|
|
290
243
|
│ ├── cauchy_pdf(x: Any, x0: Any, gamma: Any) -> Any
|
|
@@ -295,22 +248,22 @@ PyPyNum
|
|
|
295
248
|
│ ├── f_pdf(x: Any, dfnum: Any, dfden: Any) -> Any
|
|
296
249
|
│ ├── gamma_pdf(x: Any, shape: Any, scale: Any) -> Any
|
|
297
250
|
│ ├── geometric_pmf(k: Any, p: Any) -> Any
|
|
298
|
-
│ ├── hypergeom_pmf(
|
|
299
|
-
│ ├── invgauss_pdf(x: Any, mu: Any,
|
|
251
|
+
│ ├── hypergeom_pmf(M: Any, n: Any, N: Any, k: Any) -> Any
|
|
252
|
+
│ ├── invgauss_pdf(x: Any, mu: Any, lam: Any) -> Any
|
|
300
253
|
│ ├── levy_pdf(x: Any, c: Any) -> Any
|
|
301
254
|
│ ├── log_logistic_cdf(x: Any, alpha: Any, beta: Any) -> Any
|
|
302
255
|
│ ├── log_logistic_pdf(x: Any, alpha: Any, beta: Any) -> Any
|
|
303
|
-
│ ├── logistic_cdf(x: Any,
|
|
304
|
-
│ ├── logistic_pdf(x: Any,
|
|
256
|
+
│ ├── logistic_cdf(x: Any, loc: Any, scale: Any) -> Any
|
|
257
|
+
│ ├── logistic_pdf(x: Any, loc: Any, scale: Any) -> Any
|
|
305
258
|
│ ├── lognorm_cdf(x: Any, mu: Any, sigma: Any) -> Any
|
|
306
|
-
│ ├── lognorm_pdf(x: Any,
|
|
259
|
+
│ ├── lognorm_pdf(x: Any, mu: Any, sigma: Any) -> Any
|
|
307
260
|
│ ├── logser_pmf(k: Any, p: Any) -> Any
|
|
308
261
|
│ ├── multinomial_pmf(k: Any, n: Any, p: Any) -> Any
|
|
309
262
|
│ ├── nbinom_pmf(k: Any, n: Any, p: Any) -> Any
|
|
310
|
-
│ ├── nhypergeom_pmf(
|
|
263
|
+
│ ├── nhypergeom_pmf(M: Any, n: Any, r: Any, k: Any) -> Any
|
|
311
264
|
│ ├── normal_cdf(x: Any, mu: Any, sigma: Any) -> Any
|
|
312
265
|
│ ├── normal_pdf(x: Any, mu: Any, sigma: Any) -> Any
|
|
313
|
-
│ ├── pareto_pdf(x: Any,
|
|
266
|
+
│ ├── pareto_pdf(x: Any, b: Any, scale: Any) -> Any
|
|
314
267
|
│ ├── poisson_pmf(k: Any, mu: Any) -> Any
|
|
315
268
|
│ ├── rayleigh_pdf(x: Any, sigma: Any) -> Any
|
|
316
269
|
│ ├── t_pdf(x: Any, df: Any) -> Any
|
|
@@ -343,6 +296,8 @@ PyPyNum
|
|
|
343
296
|
│ │ ├── Quadrilateral(object)/__init__(self: Any, a: typing.Union[list, tuple], b: typing.Union[list, tuple], c: typing.Union[list, tuple], d: typing.Union[list, tuple]) -> Any
|
|
344
297
|
│ │ └── Triangle(object)/__init__(self: Any, a: typing.Union[list, tuple], b: typing.Union[list, tuple], c: typing.Union[list, tuple]) -> Any
|
|
345
298
|
│ └── FUNCTION
|
|
299
|
+
│ ├── _rotate_point(p: Any, theta: Any, cx: Any, cy: Any) -> Any
|
|
300
|
+
│ ├── _scale_point(p: Any, k: Any, cx: Any, cy: Any) -> Any
|
|
346
301
|
│ └── distance(g1: Any, g2: Any, error: typing.Union[int, float]) -> float
|
|
347
302
|
├── graphs
|
|
348
303
|
│ ├── CLASS
|
|
@@ -357,7 +312,7 @@ PyPyNum
|
|
|
357
312
|
│ ├── CLASS
|
|
358
313
|
│ │ └── Group(object)/__init__(self: Any, data: Any, operation: Any) -> Any
|
|
359
314
|
│ └── FUNCTION
|
|
360
|
-
│ └── group(data: Any) -> Any
|
|
315
|
+
│ └── group(data: Any, operation: Any) -> Any
|
|
361
316
|
├── hypcmpnms
|
|
362
317
|
│ ├── CLASS
|
|
363
318
|
│ │ ├── Euler(object)/__init__(self: Any, y: typing.Union[int, float], p: typing.Union[int, float], r: typing.Union[int, float]) -> Any
|
|
@@ -372,9 +327,26 @@ PyPyNum
|
|
|
372
327
|
│ ├── CLASS
|
|
373
328
|
│ │ ├── BMP(pypynum.images.BaseImage)/__init__(self: Any) -> None
|
|
374
329
|
│ │ ├── BaseImage(object)/__init__(self: Any) -> None
|
|
330
|
+
│ │ ├── JPEG(pypynum.images.BaseImage)/__init__(self: Any) -> None
|
|
375
331
|
│ │ └── PNG(pypynum.images.BaseImage)/__init__(self: Any) -> None
|
|
376
332
|
│ └── FUNCTION
|
|
377
|
-
│
|
|
333
|
+
│ ├── entropy(data: typing.Any) -> float
|
|
334
|
+
│ ├── jpeg_adjust_qtable(qtable: typing.Union[list, tuple], quality: int) -> list
|
|
335
|
+
│ ├── jpeg_category(data: typing.Any, reverse: bool) -> typing.Any
|
|
336
|
+
│ ├── jpeg_channel_encoding(matrix: list, quality: int, mode: int) -> tuple
|
|
337
|
+
│ ├── jpeg_chroma_dc_huff(data: typing.Any, reverse: bool) -> typing.Any
|
|
338
|
+
│ ├── jpeg_dct8x8(block: typing.Union[list, tuple], reverse: bool) -> list
|
|
339
|
+
│ ├── jpeg_decode_pixels(scan_data: bytes, lqtable: list, cqtable: list, width: int, height: int) -> list
|
|
340
|
+
│ ├── jpeg_encode_pixels(pixels: typing.Union[list, tuple], quality: int) -> tuple
|
|
341
|
+
│ ├── jpeg_luma_dc_huff(data: typing.Any, reverse: bool) -> typing.Any
|
|
342
|
+
│ ├── jpeg_rle_decoding(sequence: typing.Union[list, tuple]) -> list
|
|
343
|
+
│ ├── jpeg_rle_encoding(sequence: typing.Union[list, tuple]) -> list
|
|
344
|
+
│ ├── jpeg_split_pixels(matrix: list) -> list
|
|
345
|
+
│ ├── jpeg_zigzag(data: typing.Union[list, tuple], reverse: bool) -> list
|
|
346
|
+
│ ├── png_apply_filter(pixels: list, above_pixels: list, filter_type: int) -> list
|
|
347
|
+
│ ├── png_reverse_filter(pixels: list, above_pixels: list, filter_type: int) -> list
|
|
348
|
+
│ ├── rgb2ycbcr(weights: typing.Union[list, tuple]) -> tuple
|
|
349
|
+
│ └── ycbcr2rgb(weights: typing.Union[list, tuple]) -> tuple
|
|
378
350
|
├── interp
|
|
379
351
|
│ ├── CLASS
|
|
380
352
|
│ └── FUNCTION
|
|
@@ -399,6 +371,7 @@ PyPyNum
|
|
|
399
371
|
│ ├── matmul2x2kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
|
|
400
372
|
│ ├── matmul3x3kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
|
|
401
373
|
│ ├── matmul4x4kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
|
|
374
|
+
│ ├── matmul8x8kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
|
|
402
375
|
│ └── matpow2x2kernel(a: typing.Union[list, tuple], n: typing.Union[int, float, complex]) -> list
|
|
403
376
|
├── logics
|
|
404
377
|
│ ├── CLASS
|
|
@@ -461,6 +434,7 @@ PyPyNum
|
|
|
461
434
|
│ ├── cumprod(lst: typing.Union[list, tuple]) -> list
|
|
462
435
|
│ ├── cumsum(lst: typing.Union[list, tuple]) -> list
|
|
463
436
|
│ ├── deriv(f: Any, x: float, h: float, method: str, args: Any, kwargs: Any) -> Any
|
|
437
|
+
│ ├── dsigmoid(x: typing.Union[int, float]) -> float
|
|
464
438
|
│ ├── erf(x: typing.Union[int, float]) -> float
|
|
465
439
|
│ ├── exgcd(a: int, b: int) -> tuple
|
|
466
440
|
│ ├── exp(x: typing.Union[int, float]) -> typing.Union[int, float]
|
|
@@ -504,7 +478,7 @@ PyPyNum
|
|
|
504
478
|
│ ├── skew(data: typing.Union[list, tuple]) -> float
|
|
505
479
|
│ ├── square_mean(numbers: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
|
|
506
480
|
│ ├── std(numbers: typing.Union[list, tuple], ddof: int) -> typing.Union[int, float, complex]
|
|
507
|
-
│ ├── sumprod(arrays: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
|
|
481
|
+
│ ├── sumprod(arrays: typing.Union[list, tuple], floating: bool) -> typing.Union[int, float, complex]
|
|
508
482
|
│ ├── tan(x: typing.Union[int, float]) -> typing.Union[int, float]
|
|
509
483
|
│ ├── tanh(x: typing.Union[int, float]) -> typing.Union[int, float]
|
|
510
484
|
│ ├── totient(n: int) -> int
|
|
@@ -514,22 +488,23 @@ PyPyNum
|
|
|
514
488
|
│ └── zeta(alpha: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
515
489
|
├── matrices
|
|
516
490
|
│ ├── CLASS
|
|
517
|
-
│ │ └── Matrix(pypynum.arrays.Array)/__init__(self: Any, data: Any, check: Any) -> Any
|
|
491
|
+
│ │ └── Matrix(pypynum.arrays.Array)/__init__(self: Any, data: Any, check: Any, dtype: Any) -> Any
|
|
518
492
|
│ └── FUNCTION
|
|
519
|
-
│ ├── cholesky(matrix: pypynum.matrices.Matrix, hermitian: bool) -> pypynum.matrices.Matrix
|
|
520
|
-
│ ├──
|
|
493
|
+
│ ├── cholesky(matrix: pypynum.matrices.Matrix, hermitian: bool, dtype: Any) -> pypynum.matrices.Matrix
|
|
494
|
+
│ ├── dctmtx(n: int, dtype: Any) -> pypynum.matrices.Matrix
|
|
495
|
+
│ ├── diag(v: typing.Any, k: int, n: int, m: int, dtype: Any) -> typing.Any
|
|
521
496
|
│ ├── diag_indices(n: int, k: int, m: int) -> tuple
|
|
522
|
-
│ ├── eigen(matrix: pypynum.matrices.Matrix) -> tuple
|
|
523
|
-
│ ├── hessenberg(matrix: pypynum.matrices.Matrix) -> tuple
|
|
524
|
-
│ ├── identity(n: int, m: int) -> pypynum.matrices.Matrix
|
|
525
|
-
│ ├── lu(matrix: pypynum.matrices.Matrix) -> tuple
|
|
526
|
-
│ ├── mat(data: Any) ->
|
|
527
|
-
│ ├── perm_mat(num_rows: int, num_cols: int, row_swaps: typing.Union[list, tuple], col_swaps: typing.Union[list, tuple], rtype: typing.Callable) -> typing.Any
|
|
497
|
+
│ ├── eigen(matrix: pypynum.matrices.Matrix, dtype: Any) -> tuple
|
|
498
|
+
│ ├── hessenberg(matrix: pypynum.matrices.Matrix, dtype: Any) -> tuple
|
|
499
|
+
│ ├── identity(n: int, m: int, dtype: Any) -> pypynum.matrices.Matrix
|
|
500
|
+
│ ├── lu(matrix: pypynum.matrices.Matrix, dtype: Any) -> tuple
|
|
501
|
+
│ ├── mat(data: typing.Any, dtype: Any) -> pypynum.matrices.Matrix
|
|
502
|
+
│ ├── perm_mat(num_rows: int, num_cols: int, row_swaps: typing.Union[list, tuple], col_swaps: typing.Union[list, tuple], rtype: typing.Callable, dtype: Any) -> typing.Any
|
|
528
503
|
│ ├── perm_mat_indices(num_rows: int, num_cols: int, row_swaps: typing.Union[list, tuple], col_swaps: typing.Union[list, tuple]) -> tuple
|
|
529
|
-
│ ├── qr(matrix: pypynum.matrices.Matrix, reduce: bool) -> tuple
|
|
530
|
-
│ ├── rank_decomp(matrix: pypynum.matrices.Matrix) -> tuple
|
|
531
|
-
│ ├── rotate90(matrix: pypynum.matrices.Matrix, times: int) -> pypynum.matrices.Matrix
|
|
532
|
-
│ ├── svd(matrix: pypynum.matrices.Matrix, full: bool, calc_uv: bool) -> tuple
|
|
504
|
+
│ ├── qr(matrix: pypynum.matrices.Matrix, reduce: bool, dtype: Any) -> tuple
|
|
505
|
+
│ ├── rank_decomp(matrix: pypynum.matrices.Matrix, dtype: Any) -> tuple
|
|
506
|
+
│ ├── rotate90(matrix: pypynum.matrices.Matrix, times: int, dtype: Any) -> pypynum.matrices.Matrix
|
|
507
|
+
│ ├── svd(matrix: pypynum.matrices.Matrix, full: bool, calc_uv: bool, dtype: Any) -> tuple
|
|
533
508
|
│ ├── tril_indices(n: int, k: int, m: int) -> tuple
|
|
534
509
|
│ └── triu_indices(n: int, k: int, m: int) -> tuple
|
|
535
510
|
├── multiprec
|
|
@@ -571,8 +546,9 @@ PyPyNum
|
|
|
571
546
|
│ ├── int2words(integer: int) -> str
|
|
572
547
|
│ ├── parse_float(s: str) -> tuple
|
|
573
548
|
│ ├── roman2int(roman_num: str) -> int
|
|
574
|
-
│ ├──
|
|
575
|
-
│
|
|
549
|
+
│ ├── round_sigfig(number: str, n: int, scientific: bool) -> str
|
|
550
|
+
│ ├── str2int(string: str) -> int
|
|
551
|
+
│ └── words2int(words: str) -> int
|
|
576
552
|
├── plotting
|
|
577
553
|
│ ├── CLASS
|
|
578
554
|
│ └── FUNCTION
|
|
@@ -580,7 +556,7 @@ PyPyNum
|
|
|
580
556
|
│ ├── 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]
|
|
581
557
|
│ ├── 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]
|
|
582
558
|
│ ├── change(data: typing.Union[list, str]) -> typing.Union[list, str]
|
|
583
|
-
│ ├──
|
|
559
|
+
│ ├── colortext(text: str, rgb: typing.Union[list, tuple]) -> str
|
|
584
560
|
│ └── 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]
|
|
585
561
|
├── polys
|
|
586
562
|
│ ├── CLASS
|
|
@@ -632,7 +608,7 @@ PyPyNum
|
|
|
632
608
|
│ ├── pelllucas(n: int, single: bool) -> typing.Union[int, list]
|
|
633
609
|
│ ├── perrin(n: int, single: bool) -> typing.Union[int, list]
|
|
634
610
|
│ ├── recaman(n: int, single: bool) -> typing.Union[int, list]
|
|
635
|
-
│ ├── stirling1(n: int) -> list
|
|
611
|
+
│ ├── stirling1(n: int, sign: bool) -> list
|
|
636
612
|
│ ├── stirling2(n: int) -> list
|
|
637
613
|
│ ├── sylvester(n: int, single: bool) -> typing.Union[int, list]
|
|
638
614
|
│ ├── tetranacci(n: int, single: bool) -> typing.Union[int, list]
|
|
@@ -646,6 +622,8 @@ PyPyNum
|
|
|
646
622
|
│ ├── besselj0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
647
623
|
│ ├── besselj1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
648
624
|
│ ├── besseljv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
625
|
+
│ ├── ellipe(m: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
626
|
+
│ ├── ellipk(m: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
649
627
|
│ ├── hyp0f1(b0: typing.Union[int, float, complex], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
650
628
|
│ ├── hyp1f1(a0: typing.Union[int, float, complex], b0: typing.Union[int, float, complex], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
651
629
|
│ ├── hyp2f1(a0: typing.Union[int, float, complex], a1: typing.Union[int, float, complex], b0: typing.Union[int, float, complex], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
|
|
@@ -677,8 +655,12 @@ PyPyNum
|
|
|
677
655
|
│ └── skewtest(data: list, two_tailed: bool) -> tuple
|
|
678
656
|
├── symbols
|
|
679
657
|
│ ├── CLASS
|
|
658
|
+
│ │ └── Expr(object)/__init__(self: Any, tree: typing.Union[str, pypynum.trees.BinaryTree]) -> Any
|
|
680
659
|
│ └── FUNCTION
|
|
681
|
-
│
|
|
660
|
+
│ ├── build_expr_tree(postfix_expr: list) -> pypynum.trees.BinaryTree
|
|
661
|
+
│ ├── infix2postfix(infix_expr: list) -> list
|
|
662
|
+
│ ├── parse_expr(expr: str) -> pypynum.symbols.Expr
|
|
663
|
+
│ └── tokenize(expr: str) -> list
|
|
682
664
|
├── tensors
|
|
683
665
|
│ ├── CLASS
|
|
684
666
|
│ │ └── Tensor(pypynum.arrays.Array)/__init__(self: Any, data: Any, check: Any) -> Any
|
|
@@ -738,15 +720,15 @@ PyPyNum
|
|
|
738
720
|
│ ├── apply(a: Any, func: Any, rtype: Any) -> Any
|
|
739
721
|
│ ├── base_ufunc(arrays: Any, func: Any, args: Any, rtype: Any) -> Any
|
|
740
722
|
│ ├── divide(x: Any, y: Any) -> Any
|
|
741
|
-
│ ├──
|
|
723
|
+
│ ├── equal(x: Any, y: Any) -> Any
|
|
742
724
|
│ ├── floor_divide(x: Any, y: Any) -> Any
|
|
743
|
-
│ ├──
|
|
744
|
-
│ ├──
|
|
745
|
-
│ ├──
|
|
746
|
-
│ ├──
|
|
725
|
+
│ ├── greater_equal(x: Any, y: Any) -> Any
|
|
726
|
+
│ ├── greater_than(x: Any, y: Any) -> Any
|
|
727
|
+
│ ├── less_equal(x: Any, y: Any) -> Any
|
|
728
|
+
│ ├── less_than(x: Any, y: Any) -> Any
|
|
747
729
|
│ ├── modulo(x: Any, y: Any) -> Any
|
|
748
730
|
│ ├── multiply(x: Any, y: Any) -> Any
|
|
749
|
-
│ ├──
|
|
731
|
+
│ ├── not_equal(x: Any, y: Any) -> Any
|
|
750
732
|
│ ├── power(x: Any, y: Any, m: Any) -> Any
|
|
751
733
|
│ ├── subtract(x: Any, y: Any) -> Any
|
|
752
734
|
│ └── ufunc_helper(x: Any, y: Any, func: Any) -> Any
|
|
@@ -756,11 +738,12 @@ PyPyNum
|
|
|
756
738
|
│ │ ├── IntervalSet(object)/__init__(self: Any, intervals: Any) -> Any
|
|
757
739
|
│ │ ├── LinkedList(object)/__init__(self: Any) -> Any
|
|
758
740
|
│ │ ├── LinkedListNode(object)/__init__(self: Any, value: Any, next_node: Any) -> Any
|
|
759
|
-
│ │
|
|
741
|
+
│ │ ├── OrderedSet(object)/__init__(self: Any, sequence: Any) -> Any
|
|
742
|
+
│ │ └── RadixInt(object)/__init__(self: Any, number: Any, base: Any) -> Any
|
|
760
743
|
│ └── FUNCTION
|
|
761
744
|
├── vectors
|
|
762
745
|
│ ├── CLASS
|
|
763
|
-
│ │ └── Vector(pypynum.arrays.Array)/__init__(self: Any, data: Any, check: Any) -> Any
|
|
746
|
+
│ │ └── Vector(pypynum.arrays.Array)/__init__(self: Any, data: Any, check: Any, dtype: Any) -> Any
|
|
764
747
|
│ └── FUNCTION
|
|
765
748
|
│ └── vec(data: Any) -> Any
|
|
766
749
|
└── zh_cn
|
|
@@ -854,7 +837,6 @@ PyPyNum
|
|
|
854
837
|
├── 序列滚动(序列: typing.Iterator[typing.Any], 偏移: int) -> typing.Iterator[typing.Any]
|
|
855
838
|
├── 归一化(数据: typing.List[float], 目标: float) -> typing.List[float]
|
|
856
839
|
├── 扩展欧几里得算法(a: int, b: int) -> typing.Tuple[int, int, int]
|
|
857
|
-
├── 拆分浮点数字符串(字符串: str) -> tuple
|
|
858
840
|
├── 排列数(总数: int, 选取数: int) -> int
|
|
859
841
|
├── 数组(数据: list, 检查: bool) -> pypynum.arrays.Array
|
|
860
842
|
├── 整数转上标(标准字符串: str) -> str
|
|
@@ -1026,7 +1008,7 @@ print("Value of exp(e^2):", exp_e_squared)
|
|
|
1026
1008
|
"""
|
|
1027
1009
|
Modulus of the complex1: 3.064156670102011971734464
|
|
1028
1010
|
Square root of the complex2: 1.630869996965458756791024890326755654659+0.9631646481434200567938527724670041364524i
|
|
1029
|
-
Power of complex1 raised to complex2: 0.
|
|
1011
|
+
Power of complex1 raised to complex2: 0.144632311554759549910373681032-0.17337039786352194417298867399i
|
|
1030
1012
|
Value of Euler's gamma constant: 0.577215664901532860606512090082402431042159336
|
|
1031
1013
|
Logarithm of 2 (base 10): 0.30102999566398119521373889472449302676818988146211
|
|
1032
1014
|
Value of exp(e^2): 1618.1779919126535017
|
|
@@ -1044,7 +1026,7 @@ Bessel Function of the first kind, order 0 at x=1: 0.7651976865579666
|
|
|
1044
1026
|
Modified Bessel function of the first kind, order 1 at x=1: 0.565159103992485
|
|
1045
1027
|
Hypergeometric function 0F1 at z=0.5 with b0=1: 1.5660829297563503
|
|
1046
1028
|
Hypergeometric function 1F1 at z=1 with a0=1, b0=1: 2.7182818284590455
|
|
1047
|
-
q-Pochhammer Symbol with a=2+1j, q=0.5+0.1j, n=2+1j: (-0.
|
|
1029
|
+
q-Pochhammer Symbol with a=2+1j, q=0.5+0.1j, n=2+1j: (-0.3335342940577659+1.8573191887407858j)
|
|
1048
1030
|
q-Gamma Function at n=2 with q=0.5+0.1j: (0.9999999999999989-4.953510875709033e-16j)
|
|
1049
1031
|
"""
|
|
1050
1032
|
|
|
@@ -1121,7 +1103,7 @@ print(equations.poly_eq(p))
|
|
|
1121
1103
|
print(equations.lin_eq(*m))
|
|
1122
1104
|
|
|
1123
1105
|
"""
|
|
1124
|
-
[(-1.5615528128088307-
|
|
1106
|
+
[(-1.5615528128088307-3.728101026218476e-24j), (1.0000000000000007+3.2415545137443745e-25j), (2.5615528128088294+7.352235277305158e-24j)]
|
|
1125
1107
|
[1.6666666666666665, -0.6666666666666666, -0.4444444444444444]
|
|
1126
1108
|
"""
|
|
1127
1109
|
|
|
@@ -1222,10 +1204,10 @@ print(random.randint(0, 9, [2, 3, 4]))
|
|
|
1222
1204
|
print(random.uniform(0, 9, [2, 3, 4]))
|
|
1223
1205
|
|
|
1224
1206
|
"""
|
|
1225
|
-
[[[0.
|
|
1226
|
-
[[[0.
|
|
1227
|
-
[[[
|
|
1228
|
-
[[[
|
|
1207
|
+
[[[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]]]
|
|
1208
|
+
[[[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]]]
|
|
1209
|
+
[[[5, 1, 4, 9], [9, 1, 6, 2], [4, 3, 1, 9]], [[0, 9, 6, 9], [7, 8, 0, 2], [9, 8, 5, 3]]]
|
|
1210
|
+
[[[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]]]
|
|
1229
1211
|
"""
|
|
1230
1212
|
|
|
1231
1213
|
print(regs.lin_reg(list(range(5)), [2, 4, 6, 7, 8]))
|
|
@@ -1244,7 +1226,7 @@ print(tools.frange(0, 3, 0.4))
|
|
|
1244
1226
|
print(tools.linspace(0, 2.8, 8))
|
|
1245
1227
|
|
|
1246
1228
|
"""
|
|
1247
|
-
{<class 'int'>: [1], <class 'float'>: [2.3, 3.14], <class 'complex'>: [(4+5j)], <class 'str'>: ['string'], <class 'type'>: [<class 'list'>, <class 'tuple'>], <class 'bool'>: [True, False], <class 'module'>: [<module 'pypynum.tools' from 'C:\\Users\\Administrator\\PycharmProjects\\
|
|
1229
|
+
{<class 'int'>: [1], <class 'float'>: [2.3, 3.14], <class 'complex'>: [(4+5j)], <class 'str'>: ['string'], <class 'type'>: [<class 'list'>, <class 'tuple'>], <class 'bool'>: [True, False], <class 'module'>: [<module 'pypynum.tools' from 'C:\\Users\\Administrator\\PycharmProjects\\PythonProject\\pypynum\\tools.py'>]}
|
|
1248
1230
|
['Python', 6, 'NumPy', <class 'int'>, 'PyPyNum', 9, 'pypynum', True]
|
|
1249
1231
|
[0.0, 0.4, 0.8, 1.2000000000000002, 1.6, 2.0, 2.4000000000000004, 2.8000000000000003, 3.2]
|
|
1250
1232
|
[0.0, 0.39999999999999997, 0.7999999999999999, 1.2, 1.5999999999999999, 1.9999999999999998, 2.4, 2.8]
|
pypynum/__init__.py
CHANGED
|
@@ -11,9 +11,9 @@ r"""
|
|
|
11
11
|
PyPyNum
|
|
12
12
|
==========
|
|
13
13
|
|
|
14
|
-
PyPyNum is a
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
PyPyNum is a versatile Python math lib. It features modules for math, data analysis, arrays, crypto, physics, RNG,
|
|
15
|
+
data proc, stats, eq solving, image proc, interp, matrix calc, and high-prec math. Designed for scientific computing,
|
|
16
|
+
data science, and ML, it offers efficient, general-purpose tools.
|
|
17
17
|
|
|
18
18
|
Copyright
|
|
19
19
|
==========
|
|
@@ -60,7 +60,7 @@ from .seqs import *
|
|
|
60
60
|
from .special import *
|
|
61
61
|
from .stattest import *
|
|
62
62
|
from .symbols import *
|
|
63
|
-
from .
|
|
63
|
+
from . import tensors
|
|
64
64
|
from .tools import *
|
|
65
65
|
from .trees import *
|
|
66
66
|
from .types import config
|
|
@@ -68,7 +68,7 @@ from .ufuncs import *
|
|
|
68
68
|
from .utils import *
|
|
69
69
|
from .vectors import *
|
|
70
70
|
|
|
71
|
-
__version__ = "1.
|
|
71
|
+
__version__ = "1.18.1"
|
|
72
72
|
print("PyPyNum", "Version -> " + __version__, "PyPI -> https://pypi.org/project/PyPyNum/",
|
|
73
73
|
"Gitee -> https://www.gitee.com/PythonSJL/PyPyNum", "GitHub -> https://github.com/PythonSJL/PyPyNum", sep=" | ")
|
|
74
74
|
for key, value in tuple(globals().items()):
|