PyPyNum 1.8.0__tar.gz → 1.8.2__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.
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/PKG-INFO +59 -92
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/PyPyNum.egg-info/PKG-INFO +59 -92
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/PyPyNum.egg-info/SOURCES.txt +0 -1
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Array.py +5 -2
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Matrix.py +236 -32
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Quaternion.py +1 -1
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/README.md +55 -88
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Vector.py +2 -2
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/__init__.py +3 -3
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/equations.py +3 -4
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/maths.py +15 -10
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/plotting.py +1 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/test.py +2 -1
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/this.py +2 -1
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/setup.py +12 -20
- PyPyNum-1.8.0/pypynum/__temporary.py +0 -169
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/PyPyNum.egg-info/dependency_links.txt +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/PyPyNum.egg-info/top_level.txt +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/FourierT.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Geometry.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Graph.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Group.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Logic.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/NeuralN.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/PyPyNum.png +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Symbolics.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Tensor.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Tree.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/chars.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/cipher.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/constants.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/errors.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/file.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/numbers.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/polynomial.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/probability.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/random.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/regression.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/sequence.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/tools.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/types.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/utils.py +0 -0
- {PyPyNum-1.8.0 → PyPyNum-1.8.2}/setup.cfg +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyPyNum
|
|
3
|
-
Version: 1.8.
|
|
4
|
-
Summary: A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.
|
|
5
|
-
Home-page: https://
|
|
3
|
+
Version: 1.8.2
|
|
4
|
+
Summary: A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.4]
|
|
5
|
+
Home-page: https://github.com/PythonSJL/PyPyNum
|
|
6
6
|
Author: Shen Jiayi
|
|
7
7
|
Author-email: 2261748025@qq.com
|
|
8
8
|
License:
|
|
@@ -669,13 +669,13 @@ License:
|
|
|
669
669
|
<http://www.gnu.org/licenses/>.
|
|
670
670
|
|
|
671
671
|
Keywords: math,数学,mathematics,数学计算,numerical,数值,computation,计算,scientific,科学,algebra,代数,calculus,微积分,statistics,统计,linear-algebra,线性代数,optimization,优化,numerical-analysis,数值分析,matrix,矩阵,vector,向量,tensor,张量,numerics,数值计算,library,库,tools,工具,utils,实用程序,algorithms,算法,software,软件,package,包,methods,方法,data-science,数据科学,machine-learning,机器学习,computational,计算的,operations,操作,functions,函数,processing,处理,programming,编程,simulation,仿真,visualization,可视化,physics,物理
|
|
672
|
-
Requires-Python: >=3.
|
|
672
|
+
Requires-Python: >=3.4
|
|
673
673
|
Description-Content-Type: text/markdown
|
|
674
674
|
|
|
675
675
|
# <font color = blue>PyPyNum</font>
|
|
676
676
|
|
|
677
677
|
<font color = gree>A multifunctional mathematical calculation package written in pure Python programming language
|
|
678
|
-
</font><font color = red>[Python>=3.
|
|
678
|
+
</font><font color = red>[Python>=3.4]</font>
|
|
679
679
|
|
|
680
680
|
```
|
|
681
681
|
________ ___ ___ ________ ___ ___ ________ ___ ___ _____ ______
|
|
@@ -692,7 +692,7 @@ Description-Content-Type: text/markdown
|
|
|
692
692
|
[](https://pepy.tech/project/pypynum)
|
|
693
693
|
[](https://pepy.tech/project/pypynum)
|
|
694
694
|
|
|
695
|
-
## Version -> 1.8.
|
|
695
|
+
## Version -> 1.8.2 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
|
|
696
696
|
|
|
697
697
|

|
|
698
698
|
|
|
@@ -704,8 +704,9 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee.
|
|
|
704
704
|
|
|
705
705
|
#### Introduction
|
|
706
706
|
|
|
707
|
-
+
|
|
708
|
-
+
|
|
707
|
+
+ 多功能数学库,类似于numpy、scipy等,专为PyPy解释器制作,亦支持其他类型的Python解释器
|
|
708
|
+
+ Multi functional math library, similar to numpy, scipy, etc., designed specifically for PyPy interpreters and also
|
|
709
|
+
supports other types of Python interpreters
|
|
709
710
|
+ 不定期更新版本,增加更多实用功能
|
|
710
711
|
+ Update versions periodically to add more practical features
|
|
711
712
|
+ 如需联系,QQ 2261748025 (Py𝙿𝚢𝚝𝚑𝚘𝚗-水晶兰)
|
|
@@ -741,90 +742,49 @@ Python interpreter and run it!)
|
|
|
741
742
|
```
|
|
742
743
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
743
744
|
|
|
744
|
-
|
|
745
|
+
已确认此库能够向下兼容Python 3.4版本
|
|
746
|
+
以此支持IronPython解释器。
|
|
745
747
|
|
|
746
|
-
|
|
748
|
+
It has been confirmed that this
|
|
749
|
+
library is backward compatible
|
|
750
|
+
with Python version 3.4 to
|
|
751
|
+
support the IronPython
|
|
752
|
+
interpreter.
|
|
747
753
|
|
|
748
754
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
749
755
|
|
|
750
|
-
|
|
751
|
-
以生成任意大于等于三的整数阶幻方。
|
|
756
|
+
修改并优化了部分功能。
|
|
752
757
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
generate any integer order magic
|
|
756
|
-
square greater than or equal to
|
|
757
|
-
three.
|
|
758
|
+
Modified and optimized some
|
|
759
|
+
features.
|
|
758
760
|
|
|
759
761
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
760
762
|
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
first search for graph
|
|
777
|
-
traversal. It also has functions
|
|
778
|
-
such as calculating the shortest
|
|
779
|
-
path.
|
|
763
|
+
修改了fill函数,该函数将一维值序列填充
|
|
764
|
+
到指定形状的数组中。如果未指定列表,则默
|
|
765
|
+
认为从零开始递增的序列。此函数默认为循环
|
|
766
|
+
填充,否则使用零填充来填充剩余位置。
|
|
767
|
+
|
|
768
|
+
Modified the fill function,
|
|
769
|
+
which fills a one-dimensional
|
|
770
|
+
value sequence into an array of
|
|
771
|
+
specified shapes. If no list is
|
|
772
|
+
specified, it defaults to a
|
|
773
|
+
sequence that increments from
|
|
774
|
+
zero. This function defaults to
|
|
775
|
+
loop padding, otherwise zero
|
|
776
|
+
padding is used to fill the
|
|
777
|
+
remaining positions.
|
|
780
778
|
|
|
781
779
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
782
780
|
|
|
783
|
-
|
|
784
|
-
个多项式对象,可以通过传入包含“(次数,
|
|
785
|
-
系数)”的二元组组成的序列创建多项式对象
|
|
786
|
-
,可以随时设置某一项的数值,并且支持多
|
|
787
|
-
项式形式的四则运算,还有取商式、取余式
|
|
788
|
-
、求幂、求模幂的功能。
|
|
789
|
-
|
|
790
|
-
Introduction to the newly added
|
|
791
|
-
module "polynomial": There is a
|
|
792
|
-
polynomial object that can be
|
|
793
|
-
created by passing in a sequence
|
|
794
|
-
of binary tuples containing
|
|
795
|
-
"degree, coefficient". The value
|
|
796
|
-
of a certain term can be set at
|
|
797
|
-
any time, and it supports
|
|
798
|
-
polynomial form arithmetic
|
|
799
|
-
operations. It also has
|
|
800
|
-
functions such as quotient,
|
|
801
|
-
remainder, exponentiation, and
|
|
802
|
-
modular exponentiation.
|
|
781
|
+
使用辛普森公式提高定积分的计算精度。
|
|
803
782
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
<<<The ellipsis in the following structure represents the original part>>>
|
|
783
|
+
Use Simpson's formula to improve
|
|
784
|
+
the calculation accuracy of
|
|
785
|
+
definite integrals.
|
|
809
786
|
|
|
810
|
-
|
|
811
|
-
★ Graph [Graph theory]
|
|
812
|
-
CLASSES
|
|
813
|
-
BaseGraph
|
|
814
|
-
BaseWeGraph
|
|
815
|
-
WeDiGraph
|
|
816
|
-
WeUnGraph
|
|
817
|
-
DiGraph
|
|
818
|
-
UnGraph
|
|
819
|
-
★ polynomial [Polynomial object]
|
|
820
|
-
CLASSES
|
|
821
|
-
Polynomial
|
|
822
|
-
FUNCTIONS
|
|
823
|
-
poly(terms=None)
|
|
824
|
-
★ tools [Other useful tools]
|
|
825
|
-
FUNCTIONS
|
|
826
|
-
...
|
|
827
|
-
magic_square(n)
|
|
787
|
+
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
828
788
|
```
|
|
829
789
|
|
|
830
790
|
### 运行用时测试
|
|
@@ -875,7 +835,7 @@ PyPyNum
|
|
|
875
835
|
Array
|
|
876
836
|
FUNCTIONS
|
|
877
837
|
array(data=None)
|
|
878
|
-
fill(shape, sequence=None)
|
|
838
|
+
fill(shape, sequence=None, repeat=True)
|
|
879
839
|
function(_array, _function, args=None)
|
|
880
840
|
get_shape(data)
|
|
881
841
|
is_valid_array(_array, _shape)
|
|
@@ -939,14 +899,16 @@ PyPyNum
|
|
|
939
899
|
CLASSES
|
|
940
900
|
Matrix
|
|
941
901
|
FUNCTIONS
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
902
|
+
eigen(matrix: pypynum.Matrix.Matrix) -> tuple
|
|
903
|
+
hessenberg(matrix: pypynum.Matrix.Matrix) -> tuple
|
|
904
|
+
identity(n: int) -> pypynum.Matrix.Matrix
|
|
905
|
+
lu(matrix: pypynum.Matrix.Matrix) -> tuple
|
|
945
906
|
mat(data)
|
|
946
|
-
qr(matrix)
|
|
907
|
+
qr(matrix: pypynum.Matrix.Matrix) -> tuple
|
|
908
|
+
rotate90(matrix: pypynum.Matrix.Matrix, times: int) -> pypynum.Matrix.Matrix
|
|
947
909
|
same(rows, cols, value=0)
|
|
948
|
-
svd(matrix)
|
|
949
|
-
tril_indices(n, k=0, m=None)
|
|
910
|
+
svd(matrix: pypynum.Matrix.Matrix) -> tuple
|
|
911
|
+
tril_indices(n: int, k: int = 0, m: int = None) -> tuple
|
|
950
912
|
zeros(_dimensions)
|
|
951
913
|
zeros_like(_nested_list)
|
|
952
914
|
★ NeuralN [A simple neural network model]
|
|
@@ -1130,6 +1092,9 @@ PyPyNum
|
|
|
1130
1092
|
average(data, weights, expected=False)
|
|
1131
1093
|
exgcd(a: int, b: int) -> tuple
|
|
1132
1094
|
crt(n: arr, a: arr) -> int
|
|
1095
|
+
isqrt(x: int) -> int
|
|
1096
|
+
is_possibly_square(n: int) -> bool
|
|
1097
|
+
is_square(n: int) -> bool
|
|
1133
1098
|
★ numbers [Conversion of various numbers]
|
|
1134
1099
|
FUNCTIONS
|
|
1135
1100
|
float2fraction(number: float, mixed: bool = False, error: float = 1e-15) -> tuple
|
|
@@ -1359,7 +1324,7 @@ print(v1.angles())
|
|
|
1359
1324
|
6.62607015e-34
|
|
1360
1325
|
1.618033988749895
|
|
1361
1326
|
3.141592653589793
|
|
1362
|
-
1000000000000
|
|
1327
|
+
1000000000000
|
|
1363
1328
|
|
|
1364
1329
|
>>> p = [1, -2, -3, 4]
|
|
1365
1330
|
>>> m = [
|
|
@@ -1373,7 +1338,9 @@ print(v1.angles())
|
|
|
1373
1338
|
>>> print(equations.polynomial_equation(p))
|
|
1374
1339
|
>>> print(equations.linear_equation(*m))
|
|
1375
1340
|
|
|
1376
|
-
[(-1.5615528128088307-6.5209667308287455e-24j)
|
|
1341
|
+
[[(-1.5615528128088307-6.5209667308287455e-24j) 0 0]
|
|
1342
|
+
[ 0 (2.5615528128088294+4.456233626665941e-24j) 0]
|
|
1343
|
+
[ 0 0 (1.0000000000000007+3.241554513744382e-25j)]]
|
|
1377
1344
|
[ 1.6666666666666667 -0.6666666666666666 -0.4444444444444444]
|
|
1378
1345
|
|
|
1379
1346
|
>>> print(maths.cot(constants.pi / 3))
|
|
@@ -1468,10 +1435,10 @@ print(v1.angles())
|
|
|
1468
1435
|
>>> print(random.randint(0, 9, [2, 3, 4]))
|
|
1469
1436
|
>>> print(random.uniform(0, 9, [2, 3, 4]))
|
|
1470
1437
|
|
|
1471
|
-
[[[
|
|
1472
|
-
[[[0.
|
|
1473
|
-
[[[
|
|
1474
|
-
[[[
|
|
1438
|
+
[[[1.524086835643172, -0.20868457467847845, 0.5240261503975477, -0.6439838767682032], [-1.091904210196648, -0.20567633973733265, 1.374424576574523, 0.6563097903476932], [0.2171635934136032, 1.0821030876490199, -0.8410496800310051, -0.8321549344577578]], [[0.5306996954571072, -0.4441704154154241, 1.0481960055260355, 0.39805451821848287], [-0.4006858882593715, -0.06238294764009237, -1.1536673264483728, -0.8063185246185602], [0.3029117113345387, -0.32570360518676644, 0.6608320231980702, 1.7415150171137153]]]
|
|
1439
|
+
[[[0.3736243541521843, 0.8599079983285199, 0.4260061864869946, 0.8441437619796597], [0.8955986631978392, 0.7570336992646656, 0.6706841989644684, 0.328634366074538], [0.4371430562585502, 0.9576395263025738, 0.2380278778546957, 0.806813631306664]], [[0.18549375381453237, 0.5749941389233029, 0.7009767023241946, 0.30017399397762223], [0.6661914823434657, 0.7802291606608635, 0.6847755352217044, 0.2661053533652564], [0.07937643994416943, 0.5452043474222034, 0.8026792060861194, 0.07776400257578953]]]
|
|
1440
|
+
[[[9, 0, 9, 0], [2, 6, 3, 4], [5, 8, 4, 7]], [[7, 7, 6, 3], [5, 5, 5, 8], [3, 4, 6, 6]]]
|
|
1441
|
+
[[[5.049093842782947, 1.3880585421884204, 8.533634113864629, 3.550264239771317], [3.3311351975225176, 5.131771033264564, 0.9570872044431911, 5.165536082759862], [1.2035779060925538, 8.292998518472567, 8.014641974770818, 6.251632912237915]], [[6.411677800595937, 5.365937405245105, 8.70943859614565, 4.348757668525482], [7.827612569569748, 1.3718742546020972, 0.5252489627763138, 2.065015517785291], [4.620664668451086, 2.604569735623819, 5.548107842615733, 7.60342292447815]]]
|
|
1475
1442
|
|
|
1476
1443
|
>>> print(regression.linear_regression(list(range(5)), [2, 4, 6, 7, 8]))
|
|
1477
1444
|
>>> print(regression.parabolic_regression(list(range(5)), [2, 4, 6, 7, 8]))
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyPyNum
|
|
3
|
-
Version: 1.8.
|
|
4
|
-
Summary: A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.
|
|
5
|
-
Home-page: https://
|
|
3
|
+
Version: 1.8.2
|
|
4
|
+
Summary: A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.4]
|
|
5
|
+
Home-page: https://github.com/PythonSJL/PyPyNum
|
|
6
6
|
Author: Shen Jiayi
|
|
7
7
|
Author-email: 2261748025@qq.com
|
|
8
8
|
License:
|
|
@@ -669,13 +669,13 @@ License:
|
|
|
669
669
|
<http://www.gnu.org/licenses/>.
|
|
670
670
|
|
|
671
671
|
Keywords: math,数学,mathematics,数学计算,numerical,数值,computation,计算,scientific,科学,algebra,代数,calculus,微积分,statistics,统计,linear-algebra,线性代数,optimization,优化,numerical-analysis,数值分析,matrix,矩阵,vector,向量,tensor,张量,numerics,数值计算,library,库,tools,工具,utils,实用程序,algorithms,算法,software,软件,package,包,methods,方法,data-science,数据科学,machine-learning,机器学习,computational,计算的,operations,操作,functions,函数,processing,处理,programming,编程,simulation,仿真,visualization,可视化,physics,物理
|
|
672
|
-
Requires-Python: >=3.
|
|
672
|
+
Requires-Python: >=3.4
|
|
673
673
|
Description-Content-Type: text/markdown
|
|
674
674
|
|
|
675
675
|
# <font color = blue>PyPyNum</font>
|
|
676
676
|
|
|
677
677
|
<font color = gree>A multifunctional mathematical calculation package written in pure Python programming language
|
|
678
|
-
</font><font color = red>[Python>=3.
|
|
678
|
+
</font><font color = red>[Python>=3.4]</font>
|
|
679
679
|
|
|
680
680
|
```
|
|
681
681
|
________ ___ ___ ________ ___ ___ ________ ___ ___ _____ ______
|
|
@@ -692,7 +692,7 @@ Description-Content-Type: text/markdown
|
|
|
692
692
|
[](https://pepy.tech/project/pypynum)
|
|
693
693
|
[](https://pepy.tech/project/pypynum)
|
|
694
694
|
|
|
695
|
-
## Version -> 1.8.
|
|
695
|
+
## Version -> 1.8.2 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
|
|
696
696
|
|
|
697
697
|

|
|
698
698
|
|
|
@@ -704,8 +704,9 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee.
|
|
|
704
704
|
|
|
705
705
|
#### Introduction
|
|
706
706
|
|
|
707
|
-
+
|
|
708
|
-
+
|
|
707
|
+
+ 多功能数学库,类似于numpy、scipy等,专为PyPy解释器制作,亦支持其他类型的Python解释器
|
|
708
|
+
+ Multi functional math library, similar to numpy, scipy, etc., designed specifically for PyPy interpreters and also
|
|
709
|
+
supports other types of Python interpreters
|
|
709
710
|
+ 不定期更新版本,增加更多实用功能
|
|
710
711
|
+ Update versions periodically to add more practical features
|
|
711
712
|
+ 如需联系,QQ 2261748025 (Py𝙿𝚢𝚝𝚑𝚘𝚗-水晶兰)
|
|
@@ -741,90 +742,49 @@ Python interpreter and run it!)
|
|
|
741
742
|
```
|
|
742
743
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
743
744
|
|
|
744
|
-
|
|
745
|
+
已确认此库能够向下兼容Python 3.4版本
|
|
746
|
+
以此支持IronPython解释器。
|
|
745
747
|
|
|
746
|
-
|
|
748
|
+
It has been confirmed that this
|
|
749
|
+
library is backward compatible
|
|
750
|
+
with Python version 3.4 to
|
|
751
|
+
support the IronPython
|
|
752
|
+
interpreter.
|
|
747
753
|
|
|
748
754
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
749
755
|
|
|
750
|
-
|
|
751
|
-
以生成任意大于等于三的整数阶幻方。
|
|
756
|
+
修改并优化了部分功能。
|
|
752
757
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
generate any integer order magic
|
|
756
|
-
square greater than or equal to
|
|
757
|
-
three.
|
|
758
|
+
Modified and optimized some
|
|
759
|
+
features.
|
|
758
760
|
|
|
759
761
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
760
762
|
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
first search for graph
|
|
777
|
-
traversal. It also has functions
|
|
778
|
-
such as calculating the shortest
|
|
779
|
-
path.
|
|
763
|
+
修改了fill函数,该函数将一维值序列填充
|
|
764
|
+
到指定形状的数组中。如果未指定列表,则默
|
|
765
|
+
认为从零开始递增的序列。此函数默认为循环
|
|
766
|
+
填充,否则使用零填充来填充剩余位置。
|
|
767
|
+
|
|
768
|
+
Modified the fill function,
|
|
769
|
+
which fills a one-dimensional
|
|
770
|
+
value sequence into an array of
|
|
771
|
+
specified shapes. If no list is
|
|
772
|
+
specified, it defaults to a
|
|
773
|
+
sequence that increments from
|
|
774
|
+
zero. This function defaults to
|
|
775
|
+
loop padding, otherwise zero
|
|
776
|
+
padding is used to fill the
|
|
777
|
+
remaining positions.
|
|
780
778
|
|
|
781
779
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
782
780
|
|
|
783
|
-
|
|
784
|
-
个多项式对象,可以通过传入包含“(次数,
|
|
785
|
-
系数)”的二元组组成的序列创建多项式对象
|
|
786
|
-
,可以随时设置某一项的数值,并且支持多
|
|
787
|
-
项式形式的四则运算,还有取商式、取余式
|
|
788
|
-
、求幂、求模幂的功能。
|
|
789
|
-
|
|
790
|
-
Introduction to the newly added
|
|
791
|
-
module "polynomial": There is a
|
|
792
|
-
polynomial object that can be
|
|
793
|
-
created by passing in a sequence
|
|
794
|
-
of binary tuples containing
|
|
795
|
-
"degree, coefficient". The value
|
|
796
|
-
of a certain term can be set at
|
|
797
|
-
any time, and it supports
|
|
798
|
-
polynomial form arithmetic
|
|
799
|
-
operations. It also has
|
|
800
|
-
functions such as quotient,
|
|
801
|
-
remainder, exponentiation, and
|
|
802
|
-
modular exponentiation.
|
|
781
|
+
使用辛普森公式提高定积分的计算精度。
|
|
803
782
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
<<<The ellipsis in the following structure represents the original part>>>
|
|
783
|
+
Use Simpson's formula to improve
|
|
784
|
+
the calculation accuracy of
|
|
785
|
+
definite integrals.
|
|
809
786
|
|
|
810
|
-
|
|
811
|
-
★ Graph [Graph theory]
|
|
812
|
-
CLASSES
|
|
813
|
-
BaseGraph
|
|
814
|
-
BaseWeGraph
|
|
815
|
-
WeDiGraph
|
|
816
|
-
WeUnGraph
|
|
817
|
-
DiGraph
|
|
818
|
-
UnGraph
|
|
819
|
-
★ polynomial [Polynomial object]
|
|
820
|
-
CLASSES
|
|
821
|
-
Polynomial
|
|
822
|
-
FUNCTIONS
|
|
823
|
-
poly(terms=None)
|
|
824
|
-
★ tools [Other useful tools]
|
|
825
|
-
FUNCTIONS
|
|
826
|
-
...
|
|
827
|
-
magic_square(n)
|
|
787
|
+
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
828
788
|
```
|
|
829
789
|
|
|
830
790
|
### 运行用时测试
|
|
@@ -875,7 +835,7 @@ PyPyNum
|
|
|
875
835
|
Array
|
|
876
836
|
FUNCTIONS
|
|
877
837
|
array(data=None)
|
|
878
|
-
fill(shape, sequence=None)
|
|
838
|
+
fill(shape, sequence=None, repeat=True)
|
|
879
839
|
function(_array, _function, args=None)
|
|
880
840
|
get_shape(data)
|
|
881
841
|
is_valid_array(_array, _shape)
|
|
@@ -939,14 +899,16 @@ PyPyNum
|
|
|
939
899
|
CLASSES
|
|
940
900
|
Matrix
|
|
941
901
|
FUNCTIONS
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
902
|
+
eigen(matrix: pypynum.Matrix.Matrix) -> tuple
|
|
903
|
+
hessenberg(matrix: pypynum.Matrix.Matrix) -> tuple
|
|
904
|
+
identity(n: int) -> pypynum.Matrix.Matrix
|
|
905
|
+
lu(matrix: pypynum.Matrix.Matrix) -> tuple
|
|
945
906
|
mat(data)
|
|
946
|
-
qr(matrix)
|
|
907
|
+
qr(matrix: pypynum.Matrix.Matrix) -> tuple
|
|
908
|
+
rotate90(matrix: pypynum.Matrix.Matrix, times: int) -> pypynum.Matrix.Matrix
|
|
947
909
|
same(rows, cols, value=0)
|
|
948
|
-
svd(matrix)
|
|
949
|
-
tril_indices(n, k=0, m=None)
|
|
910
|
+
svd(matrix: pypynum.Matrix.Matrix) -> tuple
|
|
911
|
+
tril_indices(n: int, k: int = 0, m: int = None) -> tuple
|
|
950
912
|
zeros(_dimensions)
|
|
951
913
|
zeros_like(_nested_list)
|
|
952
914
|
★ NeuralN [A simple neural network model]
|
|
@@ -1130,6 +1092,9 @@ PyPyNum
|
|
|
1130
1092
|
average(data, weights, expected=False)
|
|
1131
1093
|
exgcd(a: int, b: int) -> tuple
|
|
1132
1094
|
crt(n: arr, a: arr) -> int
|
|
1095
|
+
isqrt(x: int) -> int
|
|
1096
|
+
is_possibly_square(n: int) -> bool
|
|
1097
|
+
is_square(n: int) -> bool
|
|
1133
1098
|
★ numbers [Conversion of various numbers]
|
|
1134
1099
|
FUNCTIONS
|
|
1135
1100
|
float2fraction(number: float, mixed: bool = False, error: float = 1e-15) -> tuple
|
|
@@ -1359,7 +1324,7 @@ print(v1.angles())
|
|
|
1359
1324
|
6.62607015e-34
|
|
1360
1325
|
1.618033988749895
|
|
1361
1326
|
3.141592653589793
|
|
1362
|
-
1000000000000
|
|
1327
|
+
1000000000000
|
|
1363
1328
|
|
|
1364
1329
|
>>> p = [1, -2, -3, 4]
|
|
1365
1330
|
>>> m = [
|
|
@@ -1373,7 +1338,9 @@ print(v1.angles())
|
|
|
1373
1338
|
>>> print(equations.polynomial_equation(p))
|
|
1374
1339
|
>>> print(equations.linear_equation(*m))
|
|
1375
1340
|
|
|
1376
|
-
[(-1.5615528128088307-6.5209667308287455e-24j)
|
|
1341
|
+
[[(-1.5615528128088307-6.5209667308287455e-24j) 0 0]
|
|
1342
|
+
[ 0 (2.5615528128088294+4.456233626665941e-24j) 0]
|
|
1343
|
+
[ 0 0 (1.0000000000000007+3.241554513744382e-25j)]]
|
|
1377
1344
|
[ 1.6666666666666667 -0.6666666666666666 -0.4444444444444444]
|
|
1378
1345
|
|
|
1379
1346
|
>>> print(maths.cot(constants.pi / 3))
|
|
@@ -1468,10 +1435,10 @@ print(v1.angles())
|
|
|
1468
1435
|
>>> print(random.randint(0, 9, [2, 3, 4]))
|
|
1469
1436
|
>>> print(random.uniform(0, 9, [2, 3, 4]))
|
|
1470
1437
|
|
|
1471
|
-
[[[
|
|
1472
|
-
[[[0.
|
|
1473
|
-
[[[
|
|
1474
|
-
[[[
|
|
1438
|
+
[[[1.524086835643172, -0.20868457467847845, 0.5240261503975477, -0.6439838767682032], [-1.091904210196648, -0.20567633973733265, 1.374424576574523, 0.6563097903476932], [0.2171635934136032, 1.0821030876490199, -0.8410496800310051, -0.8321549344577578]], [[0.5306996954571072, -0.4441704154154241, 1.0481960055260355, 0.39805451821848287], [-0.4006858882593715, -0.06238294764009237, -1.1536673264483728, -0.8063185246185602], [0.3029117113345387, -0.32570360518676644, 0.6608320231980702, 1.7415150171137153]]]
|
|
1439
|
+
[[[0.3736243541521843, 0.8599079983285199, 0.4260061864869946, 0.8441437619796597], [0.8955986631978392, 0.7570336992646656, 0.6706841989644684, 0.328634366074538], [0.4371430562585502, 0.9576395263025738, 0.2380278778546957, 0.806813631306664]], [[0.18549375381453237, 0.5749941389233029, 0.7009767023241946, 0.30017399397762223], [0.6661914823434657, 0.7802291606608635, 0.6847755352217044, 0.2661053533652564], [0.07937643994416943, 0.5452043474222034, 0.8026792060861194, 0.07776400257578953]]]
|
|
1440
|
+
[[[9, 0, 9, 0], [2, 6, 3, 4], [5, 8, 4, 7]], [[7, 7, 6, 3], [5, 5, 5, 8], [3, 4, 6, 6]]]
|
|
1441
|
+
[[[5.049093842782947, 1.3880585421884204, 8.533634113864629, 3.550264239771317], [3.3311351975225176, 5.131771033264564, 0.9570872044431911, 5.165536082759862], [1.2035779060925538, 8.292998518472567, 8.014641974770818, 6.251632912237915]], [[6.411677800595937, 5.365937405245105, 8.70943859614565, 4.348757668525482], [7.827612569569748, 1.3718742546020972, 0.5252489627763138, 2.065015517785291], [4.620664668451086, 2.604569735623819, 5.548107842615733, 7.60342292447815]]]
|
|
1475
1442
|
|
|
1476
1443
|
>>> print(regression.linear_regression(list(range(5)), [2, 4, 6, 7, 8]))
|
|
1477
1444
|
>>> print(regression.parabolic_regression(list(range(5)), [2, 4, 6, 7, 8]))
|
|
@@ -183,19 +183,22 @@ def zeros_like(_nested_list):
|
|
|
183
183
|
return 0
|
|
184
184
|
|
|
185
185
|
|
|
186
|
-
def fill(shape, sequence=None):
|
|
186
|
+
def fill(shape, sequence=None, repeat=True):
|
|
187
187
|
pointer = -1
|
|
188
188
|
length = 1
|
|
189
189
|
for item in shape:
|
|
190
190
|
length *= item
|
|
191
191
|
if sequence is None:
|
|
192
192
|
sequence = list(range(length))
|
|
193
|
+
total = len(sequence)
|
|
193
194
|
|
|
194
195
|
def inner(_shape):
|
|
195
196
|
nonlocal pointer
|
|
196
197
|
if len(_shape) == 0:
|
|
198
|
+
if pointer == total and not repeat:
|
|
199
|
+
return 0
|
|
197
200
|
pointer += 1
|
|
198
|
-
return sequence[pointer %
|
|
201
|
+
return sequence[pointer % total]
|
|
199
202
|
else:
|
|
200
203
|
_array = []
|
|
201
204
|
for i in range(_shape[0]):
|