PyPyNum 1.9.2__tar.gz → 1.10.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 (44) hide show
  1. {pypynum-1.9.2 → pypynum-1.10.0}/PKG-INFO +251 -130
  2. {pypynum-1.9.2 → pypynum-1.10.0}/PyPyNum.egg-info/PKG-INFO +251 -130
  3. {pypynum-1.9.2 → pypynum-1.10.0}/PyPyNum.egg-info/SOURCES.txt +1 -0
  4. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/Array.py +16 -0
  5. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/Group.py +3 -16
  6. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/Matrix.py +74 -61
  7. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/README.md +250 -129
  8. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/Vector.py +0 -14
  9. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/__init__.py +22 -3
  10. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/equations.py +2 -2
  11. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/file.py +5 -1
  12. pypynum-1.10.0/pypynum/image.py +260 -0
  13. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/maths.py +130 -111
  14. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/numbers.py +14 -6
  15. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/polynomial.py +7 -2
  16. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/regression.py +4 -4
  17. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/test.py +10 -10
  18. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/tools.py +28 -28
  19. {pypynum-1.9.2 → pypynum-1.10.0}/setup.py +1 -1
  20. {pypynum-1.9.2 → pypynum-1.10.0}/PyPyNum.egg-info/dependency_links.txt +0 -0
  21. {pypynum-1.9.2 → pypynum-1.10.0}/PyPyNum.egg-info/top_level.txt +0 -0
  22. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/FourierT.py +0 -0
  23. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/Geometry.py +0 -0
  24. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/Graph.py +0 -0
  25. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/Logic.py +0 -0
  26. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/NeuralN.py +0 -0
  27. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/PyPyNum.png +0 -0
  28. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/Quaternion.py +0 -0
  29. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/Symbolics.py +0 -0
  30. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/Tensor.py +0 -0
  31. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/Tree.py +0 -0
  32. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/chars.py +0 -0
  33. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/cipher.py +0 -0
  34. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/constants.py +0 -0
  35. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/errors.py +0 -0
  36. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/plotting.py +0 -0
  37. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/probability.py +0 -0
  38. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/random.py +0 -0
  39. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/sequence.py +0 -0
  40. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/this.py +0 -0
  41. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/types.py +0 -0
  42. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/ufuncs.py +0 -0
  43. {pypynum-1.9.2 → pypynum-1.10.0}/pypynum/utils.py +0 -0
  44. {pypynum-1.9.2 → pypynum-1.10.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyPyNum
3
- Version: 1.9.2
3
+ Version: 1.10.0
4
4
  Summary: A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.4]
5
5
  Home-page: https://github.com/PythonSJL/PyPyNum
6
6
  Author: Shen Jiayi
@@ -692,7 +692,7 @@ Description-Content-Type: text/markdown
692
692
  [![Downloads](https://static.pepy.tech/badge/pypynum/month)](https://pepy.tech/project/pypynum)
693
693
  [![Downloads](https://static.pepy.tech/badge/pypynum/week)](https://pepy.tech/project/pypynum)
694
694
 
695
- ## Version -> 1.9.2 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
695
+ ## Version -> 1.10.0 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
696
696
 
697
697
  ![LOGO](PyPyNum.png)
698
698
 
@@ -716,41 +716,42 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee or GitHub.
716
716
 
717
717
  #### Name and Function Introduction of Submodules
718
718
 
719
- | 子模块名称 Submodule Name | 功能简介 Function Introduction |
720
- |-----------------------|--------------------------------------------|
721
- | `pypynum.Array` | 多维数组 Multidimensional array |
722
- | `pypynum.chars` | 特殊数学符号 Special mathematical symbols |
723
- | `pypynum.cipher` | 加密解密算法 Encryption and decryption algorithm |
724
- | `pypynum.constants` | 数学常数集合 Set of mathematical constants |
725
- | `pypynum.equations` | 方程求解 Solving equations |
726
- | `pypynum.errors` | 异常对象 Exception object |
727
- | `pypynum.file` | 文件读写 File read and write |
728
- | `pypynum.FourierT` | 傅里叶变换 Fourier transform |
729
- | `pypynum.Geometry` | 几何形状 Geometric shape |
730
- | `pypynum.Graph` | 图论算法 Graph Theory Algorithm |
731
- | `pypynum.Group` | 群论算法 Group Theory Algorithm |
732
- | `pypynum.Logic` | 逻辑电路设计 Logic circuit design |
733
- | `pypynum.maths` | 通用数学函数 General mathematical functions |
734
- | `pypynum.Matrix` | 矩阵运算 Matrix operation |
735
- | `pypynum.NeuralN` | 神经网络训练 Neural network training |
736
- | `pypynum.numbers` | 数字处理 Number processing |
737
- | `pypynum.plotting` | 数据可视化 Data visualization |
738
- | `pypynum.polynomial` | 多项式运算 Polynomial operation |
739
- | `pypynum.probability` | 概率统计 Probability statistics |
740
- | `pypynum.Quaternion` | 四元数运算 Quaternion operation |
741
- | `pypynum.random` | 随机数生成 Random number generation |
742
- | `pypynum.regression` | 回归分析 Regression analysis |
743
- | `pypynum.sequence` | 数列计算 Sequence calculation |
744
- | `pypynum.Symbolics` | 符号计算 Symbol calculation |
745
- | `pypynum.Tensor` | 张量运算 Tensor operation |
746
- | `pypynum.test` | 简易测试 Easy test |
747
- | `pypynum.this` | 项目之禅 Zen of Projects |
748
- | `pypynum.tools` | 辅助函数 Auxiliary functions |
749
- | `pypynum.Tree` | 树形数据结构 Tree data structure |
750
- | `pypynum.types` | 特殊类型 Special types |
751
- | `pypynum.ufuncs` | 通用函数 Universal functions |
752
- | `pypynum.utils` | 实用工具 Utility |
753
- | `pypynum.Vector` | 向量运算 Vector operation |
719
+ | 子模块名称 Submodule Name | 功能简介 Function Introduction |
720
+ |:---------------------:|:------------------------------------------:|
721
+ | `pypynum.Array` | 多维数组 Multidimensional array |
722
+ | `pypynum.chars` | 特殊数学符号 Special mathematical symbols |
723
+ | `pypynum.cipher` | 加密解密算法 Encryption and decryption algorithm |
724
+ | `pypynum.constants` | 数学常数集合 Set of mathematical constants |
725
+ | `pypynum.equations` | 方程求解 Solving equations |
726
+ | `pypynum.errors` | 异常对象 Exception object |
727
+ | `pypynum.file` | 文件读写 File read and write |
728
+ | `pypynum.FourierT` | 傅里叶变换 Fourier transform |
729
+ | `pypynum.Geometry` | 几何形状 Geometric shape |
730
+ | `pypynum.Graph` | 图论算法 Graph Theory Algorithm |
731
+ | `pypynum.Group` | 群论算法 Group Theory Algorithm |
732
+ | `pypynum.image` | 图像处理 Image processing |
733
+ | `pypynum.Logic` | 逻辑电路设计 Logic circuit design |
734
+ | `pypynum.maths` | 通用数学函数 General mathematical functions |
735
+ | `pypynum.Matrix` | 矩阵运算 Matrix operation |
736
+ | `pypynum.NeuralN` | 神经网络训练 Neural network training |
737
+ | `pypynum.numbers` | 数字处理 Number processing |
738
+ | `pypynum.plotting` | 数据可视化 Data visualization |
739
+ | `pypynum.polynomial` | 多项式运算 Polynomial operation |
740
+ | `pypynum.probability` | 概率统计 Probability statistics |
741
+ | `pypynum.Quaternion` | 四元数运算 Quaternion operation |
742
+ | `pypynum.random` | 随机数生成 Random number generation |
743
+ | `pypynum.regression` | 回归分析 Regression analysis |
744
+ | `pypynum.sequence` | 数列计算 Sequence calculation |
745
+ | `pypynum.Symbolics` | 符号计算 Symbol calculation |
746
+ | `pypynum.Tensor` | 张量运算 Tensor operation |
747
+ | `pypynum.test` | 简易测试 Easy test |
748
+ | `pypynum.this` | 项目之禅 Zen of Projects |
749
+ | `pypynum.tools` | 辅助函数 Auxiliary functions |
750
+ | `pypynum.Tree` | 树形数据结构 Tree data structure |
751
+ | `pypynum.types` | 特殊类型 Special types |
752
+ | `pypynum.ufuncs` | 通用函数 Universal functions |
753
+ | `pypynum.utils` | 实用工具 Utility |
754
+ | `pypynum.Vector` | 向量运算 Vector operation |
754
755
 
755
756
  ### PyPyNum的Zen(预览)
756
757
 
@@ -790,80 +791,201 @@ Python interpreter and run it!
790
791
  ```
791
792
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
792
793
 
793
- 新增代码行数大约三百行
794
+ 名称缩写的函数
794
795
 
795
- Approximately 300 new lines of
796
- code added
796
+ Functions with abbreviated names
797
+
798
+ linear_regression -> lin_reg
799
+ parabolic_regression -> par_reg
800
+ polynomial_regression -> poly_reg
801
+ linear_equation -> lin_eq
802
+ polynomial_equation -> poly_eq
803
+ derivative -> deriv
804
+ definite_integral -> integ
797
805
 
798
806
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
799
807
 
800
- 修改过的函数
808
+ ★ Matrix.inv(self):
809
+ ★ 速度提高约55000%
810
+ ★ Speed increased by about 55000%
801
811
 
802
- Modified functions
812
+ Matrix.outer(self, other):
813
+ 速度提高约900%
814
+ Speed increased by about 900%
803
815
 
804
- ├── Array
805
- fill(shape: Any, sequence: Any, repeat: Any, pad: Any, rtype: Any) -> Any
806
- zeros(shape: Any, rtype: Any) -> Any
807
- zeros_like(a: Any, rtype: Any) -> Any
816
+ identity(n: int) -> Matrix:
817
+ 速度提高约630%
818
+ Speed increased by about 630%
819
+
820
+ tril_indices(n: int,
821
+ k: int = 0,
822
+ m: int | None = None) -> tuple:
823
+ 速度提高约140%
824
+ Speed increased by about 140%
825
+
826
+ Matrix.kron(self, other):
827
+ 速度提高约130%
828
+ Speed increased by about 130%
829
+
830
+ Matrix.t(self):
831
+ 速度提高约70%
832
+ Speed increased by about 70%
833
+
834
+ lu(matrix: Matrix) -> tuple:
835
+ 速度提高约9%
836
+ Speed increased by about 9%
837
+
838
+ Matrix.inner(self, other):
839
+ 速度提高约5%
840
+ Speed increased by about 5%
808
841
 
809
842
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
810
843
 
811
- 新增加的函数
812
-
813
- Newly added functions
814
-
815
- class Polynomial(builtins.object)
816
- <以下为新增加的方法>
817
- <The following are the newly added methods>
818
- __divmod__ = __truediv__(self, other)
819
- __float__(self)
820
- __int__(self)
821
- __round__(self, n=None)
822
- coeffs(self, reverse=False)
823
- degs(self, reverse=False)
824
- deriv(self)
825
- evaluate(self, x)
826
- gcd(self, other)
827
- integ(self, constant=0)
828
- is_zero(self)
829
- latex(self)
830
- lcm(self, other)
831
- roots(self)
832
- sqrt(self)
844
+ 矩阵支持更好的修改元素方式
833
845
 
834
- PyPyNum
835
- ├── Array
836
- │ └── FUNCTION
837
- │ ├── full(shape: Any, fill_value: Any, rtype: Any) -> Any
838
- │ ├── full_like(a: Any, fill_value: Any, rtype: Any) -> Any
839
- │ ├── ones(shape: Any, rtype: Any) -> Any
840
- │ ├── ones_like(a: Any, rtype: Any) -> Any
841
- ├── maths
842
- │ └── FUNCTION
843
- │ ├── sumprod(arrays: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
844
- ├── polynomial
845
- │ └── FUNCTION
846
- │ ├── from_coeffs(coeffs: Any) -> Any
847
- │ ├── leggauss(polynomial: Any) -> Any
848
- │ ├── legpoly(n: Any) -> Any
849
- ├── ufuncs
850
- │ ├── CLASS
851
- │ └── FUNCTION
852
- │ ├── add(x: Any, y: Any) -> Any
853
- │ ├── base_ufunc(arrays: Any, func: Any, args: Any, rtype: Any) -> Any
854
- │ ├── divide(x: Any, y: Any) -> Any
855
- │ ├── floor_divide(x: Any, y: Any) -> Any
856
- │ ├── modulo(x: Any, y: Any) -> Any
857
- │ ├── multiply(x: Any, y: Any) -> Any
858
- │ ├── power(x: Any, y: Any, m: Any) -> Any
859
- │ ├── subtract(x: Any, y: Any) -> Any
860
- │ └── ufunc_helper(x: Any, y: Any, func: Any) -> Any
846
+ Matrix supports better ways
847
+ to modify elements
848
+
849
+ 示例 Example
850
+
851
+ A = [[0, 1, 2, 3],
852
+ [4, 5, 6, 7],
853
+ [8, 9, 10, 11],
854
+ [12, 13, 14, 15]]
855
+ matrix = mat(A)
856
+ matrix[0:2, 0:2] = [[16, 77],
857
+ [72, 16]]
858
+
859
+ !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
860
+
861
+ 这个方法添加了是否返回所有主元
862
+
863
+ This method adds whether to return all main elements
864
+
865
+ Matrix.rref(self, pivots=True)
866
+
867
+ !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
868
+
869
+ 新增的函数
870
+
871
+ New functions added
872
+
873
+ aslist(data)
874
+ asarray(data)
875
+ roll(seq, shift)
876
+
877
+ 请注意,“roll”函数目前是一个初步实现,将来将被设计为数组绑定方法。
878
+ Please note that the "roll" function is currently a preliminary implementation
879
+ and will be designed as an array binding method in the future.
880
+
881
+ !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
882
+
883
+ <<<添加了image模块>>>
884
+
885
+ <<<Added image module>>>
886
+
887
+ <<<添加了PNG类>>>
888
+
889
+ <<<Added PNG class>>>
890
+
891
+ class PNG(builtins.object)
892
+
893
+ Introduction
894
+ ==========
895
+ This is a PNG class written in pure Python,
896
+ supporting the creation, reading, modification, and saving of PNG images.
897
+
898
+ Roadmap
899
+ ==========
900
+ This class is currently in development.
901
+ Future updates will expand its functionality to enhance the capabilities of working with PNG images.
902
+
903
+ Usage
904
+ ==========
905
+
906
+ Creating a new PNG image:
907
+ ----------
908
+ To create a new PNG image, instantiate the PNG class and use the `new` method
909
+ to define the image dimensions, bit depth, and color mode.
910
+
911
+ - from png import PNG
912
+
913
+ # Create a new image with a width of 200 pixels, a height of 100 pixels,
914
+ an 8-bit depth, and the default RGB color mode.
915
+
916
+ - image = PNG()
917
+ - image.new(200, 100, 8)
918
+
919
+ # Optionally, you can specify a background color. For example, to create a new image with a blue background:
920
+
921
+ - image.new(200, 100, 8, color=(0, 0, 255))
922
+
923
+ Reading an existing PNG image:
924
+ ----------
925
+ To read an existing PNG image from a file, use the `read` method.
926
+
927
+ - image = PNG()
928
+ - image.read("example.png")
929
+
930
+ Modifying a pixel:
931
+ ----------
932
+ To modify the color of a pixel at a specific coordinate, use the `setp` method.
933
+
934
+ # Set the pixel at (10, 10) to red (255, 0, 0).
935
+
936
+ - image.setp(10, 10, (255, 0, 0))
937
+
938
+ Getting a pixel's color:
939
+ ----------
940
+ To retrieve the color of a pixel at a specific coordinate, use the `getp` method.
941
+
942
+ - color = image.getp(10, 10)
943
+ - print(color) # Output: (255, 0, 0) for the example above
944
+
945
+ Saving the image:
946
+ ----------
947
+ To save the image to a file, use the `write` method.
948
+
949
+ - image.write("output.png")
950
+
951
+ Getting image information:
952
+ ----------
953
+ To obtain information about the image, such as its dimensions and color mode, use the `info` method.
954
+
955
+ - info = image.info()
956
+ - print(info) # Output: {'width': 200, 'height': 100, 'bit_depth': 8, 'color_mode': 'RGB'}
957
+
958
+ __init__(self) -> None
959
+
960
+ __repr__(self) -> str
961
+
962
+ getp(self, x: int, y: int) -> tuple
963
+
964
+ info(self) -> dict
965
+
966
+ new(self, width: int, height: int, bit_depth: int, color: tuple = (), color_mode: str = 'RGB') -> None
967
+
968
+ read(self, filename: str) -> None
969
+
970
+ setp(self, x: int, y: int, color: tuple) -> None
971
+
972
+ write(self, filename: str = None) -> bytes
973
+
974
+ !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
861
975
  ```
862
976
 
863
977
  ### 运行用时测试
864
978
 
865
979
  #### Run Time Test
866
980
 
981
+ Python解释器版本
982
+
983
+ Python interpreter version
984
+
985
+ + CPython 3.8.10
986
+
987
+ + PyPy 3.10.12
988
+
867
989
  | 矩阵用时测试<br>Matrix Time Test | NumPy+CPython(seconds) | 排名<br>Ranking | PyPyNum+PyPy(seconds) | 排名<br>Ranking | Mpmath_+_PyPy_(_seconds_) | 排名<br>Ranking | SymPy_+_PyPy_(_seconds_) | 排名<br>Ranking |
868
990
  |:------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-------------:|
869
991
  | 创建一百阶随机数矩阵<br>Create a hundred order random number matrix | 0.000083 | 1 | 0.005374 | 2 | 0.075253 | 3 | 0.230530 | 4 |
@@ -871,9 +993,9 @@ PyPyNum
871
993
  | 一百阶矩阵相加<br>Addition of matrices of order one hundred | 0.000029 | 1 | 0.002163 | 2 | 0.045641 | 4 | 0.035700 | 3 |
872
994
  | 一千阶矩阵相加<br>Adding matrices of order one thousand | 0.002647 | 1 | 0.019111 | 2 | 1.746957 | 4 | 0.771542 | 3 |
873
995
  | 一百阶矩阵行列式<br>Determinant of a hundred order matrix | 0.087209 | 2 | 0.016331 | 1 | 4.354507 | 3 | 5.157206 | 4 |
874
- | 一千阶矩阵行列式<br>Determinant of a thousand order matrix | 0.616113 | 1 | 3.509747 | 2 | 速度极慢 | 3 | 无法计算 | 4 |
875
- | 一百阶矩阵求逆<br>Finding the inverse of a hundred order matrix | 0.162770 | 1 | 31.088849 | 4 | 8.162948 | 2 | 21.437424 | 3 |
876
- | 一千阶矩阵求逆<br>Finding the inverse of a thousand order matrix | 0.598905 | 1 | 速度较慢 | 4 | 速度较慢 | 2 | 速度较慢 | 3 |
996
+ | 一千阶矩阵行列式<br>Determinant of a thousand order matrix | 0.616113 | 1 | 3.509747 | 2 | It takes a long time | 3 | It takes a long time | 4 |
997
+ | 一百阶矩阵求逆<br>Finding the inverse of a hundred order matrix | 0.162770 | 2 | 0.015768 | 1 | 8.162948 | 3 | 21.437424 | 4 |
998
+ | 一千阶矩阵求逆<br>Finding the inverse of a thousand order matrix | 0.598905 | 1 | 17.072552 | 2 | It takes a long time | 3 | It takes a long time | 4 |
877
999
  | 数组输出效果<br>Array output effect | ```[[[[ -7 -67]```<br>```[-78  29]]```<br><br>```[[-86 -97]```<br>```[ 68  -3]]]```<br><br><br>```[[[ 11  42]```<br>```[ 24 -65]]```<br><br>```[[-60  72]```<br>```[ 73   2]]]]``` | / | ```[[[[ 37  83]```<br>```[ 40   2]]```<br><br>```[[ -5 -34]```<br>```[ -7  72]]]```<br><br><br>```[[[ 13 -64]```<br>```[  6  90]]```<br><br>```[[ 68  57]```<br>```[ 78  11]]]]``` | / | ```[-80.0   -8.0  80.0  -88.0]```<br>```[-99.0  -43.0  87.0   81.0]```<br>```[ 20.0  -55.0  98.0    8.0]```<br>```[  8.0   44.0  64.0  -35.0]```<br>(只支持矩阵)<br>(Only supports matrices) | / | ```⎡⎡16   -56⎤  ⎡ 8   -28⎤⎤```<br>```⎢⎢        ⎥  ⎢        ⎥⎥```<br>```⎢⎣-56  56 ⎦  ⎣-28  28 ⎦⎥```<br>```⎢                      ⎥```<br>```⎢ ⎡-2  7 ⎤   ⎡-18  63 ⎤⎥```<br>```⎢ ⎢      ⎥   ⎢        ⎥⎥```<br>```⎣ ⎣7   -7⎦   ⎣63   -63⎦⎦``` | / |
878
1000
 
879
1001
  ### 基本结构
@@ -887,6 +1009,8 @@ PyPyNum
887
1009
  │ │ └── Array(object)/__init__(self: Any, data: Any, check: Any) -> Any
888
1010
  │ └── FUNCTION
889
1011
  │ ├── array(data: Any) -> Any
1012
+ │ ├── asarray(data: Any) -> Any
1013
+ │ ├── aslist(data: Any) -> Any
890
1014
  │ ├── fill(shape: Any, sequence: Any, repeat: Any, pad: Any, rtype: Any) -> Any
891
1015
  │ ├── full(shape: Any, fill_value: Any, rtype: Any) -> Any
892
1016
  │ ├── full_like(a: Any, fill_value: Any, rtype: Any) -> Any
@@ -923,11 +1047,7 @@ PyPyNum
923
1047
  │ ├── CLASS
924
1048
  │ │ └── Group(object)/__init__(self: Any, data: Any) -> Any
925
1049
  │ └── FUNCTION
926
- ├── add(x: Any, y: Any) -> Any
927
- │ ├── divide(x: Any, y: Any) -> Any
928
- │ ├── group(data: Any) -> Any
929
- │ ├── multiply(x: Any, y: Any) -> Any
930
- │ └── subtract(x: Any, y: Any) -> Any
1050
+ └── group(data: Any) -> Any
931
1051
  ├── Logic
932
1052
  │ ├── CLASS
933
1053
  │ │ ├── AND(pypynum.Logic.Binary)/__init__(self: Any, label: Any, pin0: Any, pin1: Any) -> Any
@@ -965,11 +1085,8 @@ PyPyNum
965
1085
  │ ├── mat(data: Any) -> Any
966
1086
  │ ├── qr(matrix: pypynum.Matrix.Matrix) -> tuple
967
1087
  │ ├── rotate90(matrix: pypynum.Matrix.Matrix, times: int) -> pypynum.Matrix.Matrix
968
- │ ├── same(rows: Any, cols: Any, value: Any) -> Any
969
1088
  │ ├── svd(matrix: pypynum.Matrix.Matrix) -> tuple
970
- ├── tril_indices(n: int, k: int, m: int) -> tuple
971
- │ ├── zeros(_dimensions: Any) -> Any
972
- │ └── zeros_like(_nested_list: Any) -> Any
1089
+ └── tril_indices(n: int, k: int, m: int) -> tuple
973
1090
  ├── NeuralN
974
1091
  │ ├── CLASS
975
1092
  │ │ └── NeuralNetwork(object)/__init__(self: Any, _input: Any, _hidden: Any, _output: Any) -> Any
@@ -1005,10 +1122,7 @@ PyPyNum
1005
1122
  │ ├── CLASS
1006
1123
  │ │ └── Vector(pypynum.Array.Array)/__init__(self: Any, data: Any, check: Any) -> Any
1007
1124
  │ └── FUNCTION
1008
- ├── same(length: Any, value: Any) -> Any
1009
- │ ├── vec(data: Any) -> Any
1010
- │ ├── zeros(_dimensions: Any) -> Any
1011
- │ └── zeros_like(_nested_list: Any) -> Any
1125
+ └── vec(data: Any) -> Any
1012
1126
  ├── chars
1013
1127
  │ ├── CLASS
1014
1128
  │ └── FUNCTION
@@ -1033,8 +1147,8 @@ PyPyNum
1033
1147
  ├── equations
1034
1148
  │ ├── CLASS
1035
1149
  │ └── FUNCTION
1036
- │ ├── linear_equation(left: list, right: list) -> list
1037
- │ └── polynomial_equation(coefficients: list) -> list
1150
+ │ ├── lin_eq(left: list, right: list) -> list
1151
+ │ └── poly_eq(coefficients: list) -> list
1038
1152
  ├── errors
1039
1153
  │ ├── CLASS
1040
1154
  │ └── FUNCTION
@@ -1043,6 +1157,11 @@ PyPyNum
1043
1157
  │ └── FUNCTION
1044
1158
  │ ├── read(file: str) -> list
1045
1159
  │ └── write(file: str, cls: object) -> Any
1160
+ ├── image
1161
+ │ ├── CLASS
1162
+ │ │ └── PNG(object)/__init__(self: Any) -> None
1163
+ │ └── FUNCTION
1164
+ │ └── crc(data: Any, length: Any, init: Any, xor: Any) -> Any
1046
1165
  ├── maths
1047
1166
  │ ├── CLASS
1048
1167
  │ └── FUNCTION
@@ -1077,8 +1196,7 @@ PyPyNum
1077
1196
  │ ├── csch(x: typing.Union[int, float]) -> typing.Union[int, float]
1078
1197
  │ ├── cumprod(lst: typing.Union[list, tuple]) -> list
1079
1198
  │ ├── cumsum(lst: typing.Union[list, tuple]) -> list
1080
- │ ├── definite_integral(f: Any, x_start: typing.Union[int, float], x_end: typing.Union[int, float], n: int, args: Any, kwargs: Any) -> float
1081
- │ ├── derivative(f: Any, x: typing.Union[int, float], h: typing.Union[int, float], args: Any, kwargs: Any) -> float
1199
+ │ ├── deriv(f: Any, x: typing.Union[int, float], h: typing.Union[int, float], args: Any, kwargs: Any) -> float
1082
1200
  │ ├── erf(x: typing.Union[int, float]) -> float
1083
1201
  │ ├── exgcd(a: int, b: int) -> tuple
1084
1202
  │ ├── exp(x: typing.Union[int, float]) -> typing.Union[int, float]
@@ -1089,6 +1207,7 @@ PyPyNum
1089
1207
  │ ├── gcd(args: int) -> int
1090
1208
  │ ├── geom_mean(numbers: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
1091
1209
  │ ├── harm_mean(numbers: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
1210
+ │ ├── integ(f: Any, x_start: typing.Union[int, float], x_end: typing.Union[int, float], n: int, args: Any, kwargs: Any) -> float
1092
1211
  │ ├── iroot(y: int, n: int) -> int
1093
1212
  │ ├── is_possibly_square(n: int) -> bool
1094
1213
  │ ├── is_square(n: int) -> bool
@@ -1108,6 +1227,7 @@ PyPyNum
1108
1227
  │ ├── product(numbers: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
1109
1228
  │ ├── ptp(numbers: typing.Union[list, tuple]) -> typing.Union[int, float, complex]
1110
1229
  │ ├── raw_moment(data: typing.Union[list, tuple], order: int) -> float
1230
+ │ ├── roll(seq: typing.Union[list, tuple, str], shift: int) -> typing.Union[list, tuple, str]
1111
1231
  │ ├── root(x: typing.Union[int, float, complex], y: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
1112
1232
  │ ├── sec(x: typing.Union[int, float]) -> typing.Union[int, float]
1113
1233
  │ ├── sech(x: typing.Union[int, float]) -> typing.Union[int, float]
@@ -1147,6 +1267,7 @@ PyPyNum
1147
1267
  │ │ └── Polynomial(object)/__init__(self: Any, terms: Any) -> Any
1148
1268
  │ └── FUNCTION
1149
1269
  │ ├── from_coeffs(coeffs: Any) -> Any
1270
+ │ ├── from_coords(coords: Any) -> Any
1150
1271
  │ ├── leggauss(polynomial: Any) -> Any
1151
1272
  │ ├── legpoly(n: Any) -> Any
1152
1273
  │ └── poly(terms: Any) -> Any
@@ -1169,9 +1290,9 @@ PyPyNum
1169
1290
  ├── regression
1170
1291
  │ ├── CLASS
1171
1292
  │ └── FUNCTION
1172
- │ ├── linear_regression(x: typing.Union[list, tuple], y: typing.Union[list, tuple]) -> list
1173
- │ ├── parabolic_regression(x: typing.Union[list, tuple], y: typing.Union[list, tuple]) -> list
1174
- │ └── polynomial_regression(x: typing.Union[list, tuple], y: typing.Union[list, tuple], n: int) -> list
1293
+ │ ├── lin_reg(x: typing.Union[list, tuple], y: typing.Union[list, tuple]) -> list
1294
+ │ ├── par_reg(x: typing.Union[list, tuple], y: typing.Union[list, tuple]) -> list
1295
+ │ └── poly_reg(x: typing.Union[list, tuple], y: typing.Union[list, tuple], n: int) -> list
1175
1296
  ├── sequence
1176
1297
  │ ├── CLASS
1177
1298
  │ └── FUNCTION
@@ -1300,8 +1421,8 @@ print(m1.rank())
1300
1421
  [10 12]]
1301
1422
  [[19 22]
1302
1423
  [43 50]]
1303
- [[-2.0 1.0]
1304
- [ 1.5 -0.5]]
1424
+ [[ -1.9999999999999996 0.9999999999999998]
1425
+ [ 1.4999999999999998 -0.49999999999999994]]
1305
1426
  2
1306
1427
  """
1307
1428
 
@@ -1434,8 +1555,8 @@ m = [
1434
1555
  ],
1435
1556
  [-1, -2, -3]
1436
1557
  ]
1437
- print(equations.polynomial_equation(p))
1438
- print(equations.linear_equation(*m))
1558
+ print(equations.poly_eq(p))
1559
+ print(equations.lin_eq(*m))
1439
1560
 
1440
1561
  """
1441
1562
  [(-1.5615528128088307-6.5209667308287455e-24j) (1.0000000000000007+3.241554513744382e-25j) (2.5615528128088294+4.456233626665941e-24j)]
@@ -1539,20 +1660,20 @@ print(random.randint(0, 9, [2, 3, 4]))
1539
1660
  print(random.uniform(0, 9, [2, 3, 4]))
1540
1661
 
1541
1662
  """
1542
- [[[2.0337109813389342, 0.07828151434838644, 0.5770175491332994, -0.45862437785903776], [-0.5647580909376742, 0.04013315334953438, -1.4415329001085142, 0.21063309355876483], [-0.13079032580688052, -0.12269092226721959, -1.0486596849517071, 0.33707912556088127]], [[1.0924880424965842, -0.2904666571377903, -0.8147193339820543, -0.12425697574808597], [-0.9431495143889028, 1.6993259508582454, 2.459143670684122, 0.6706774051649211], [-0.2067467760214054, -1.335666880934244, -0.06604610266464511, 1.4659516633001894]]]
1543
- [[[0.5056293647418786, 0.41138133426895374, 0.1116780669974381, 0.5421022799938007], [0.8529591223803364, 0.7967626494191837, 0.6778986058446654, 0.7966034784840031], [0.8226174224158366, 0.6882274477983558, 0.2043768498847348, 0.20649565416723548]], [[0.7858708880353261, 0.293208591223893, 0.9713037501099235, 0.1277647867709274], [0.5310738736523741, 0.3775394394569467, 0.6618665928287699, 0.7813821035754579], [0.41759114496811056, 0.8741519554894022, 0.8325056303107449, 0.8127323540413558]]]
1544
- [[[5, 9, 7, 5], [9, 9, 9, 8], [6, 2, 0, 3]], [[4, 7, 5, 8], [5, 7, 2, 4], [9, 9, 2, 2]]]
1545
- [[[7.666875196011509, 4.2629925536138815, 6.269304350870346, 6.1616482850575816], [8.736107228623906, 4.050564635824004, 8.719616126170123, 8.241460211008127], [2.2965292897567497, 2.3960057526618233, 2.406429664045121, 7.644380154396355]], [[3.8027437908649793, 5.075197041264121, 3.778237396690295, 0.9427794634466875], [1.9182768078467933, 6.926954119152528, 2.5353235396092666, 3.0648655668955422], [8.538065261473607, 7.652025295242501, 4.086320910353441, 7.457914057699455]]]
1663
+ [[[1.0022026821190488, -0.38242004448759154, -0.23648445523561967, 0.43813038741951754], [-0.3778652198785619, -0.03865603124657112, -1.5186239424691736, -0.7368762975012327], [-0.7580654190380791, -1.3672869759158346, 0.582588816791107, 1.0281649895276377]], [[0.5270622699930536, 0.6132250709048543, 0.9764619731696673, -0.13740454362420268], [-2.0801461607759886, -0.1935521020633617, 0.44420106801354153, 1.4830089202063659], [-0.8790685594194517, 0.45517163054358967, -1.1448643981658326, 0.986414969442009]]]
1664
+ [[[0.13698864758140294, 0.634190467772759, 0.25683276170297875, 0.9026812741081188], [0.26303437123782614, 0.02477620234532174, 0.9947822450199725, 0.5916822332583692], [0.7523977891797228, 0.6198410071512576, 0.05799276940261333, 0.4181042411131305]], [[0.21564211884049145, 0.30667940527138227, 0.03010277335333611, 0.904264028183912], [0.33977550248572597, 0.042594462434406455, 0.6371061749651907, 0.8639246364627866], [0.009159271907318911, 0.054475512265855563, 0.7109847662274855, 0.9695933487818381]]]
1665
+ [[[1, 6, 0, 1], [0, 4, 8, 3], [2, 4, 2, 8]], [[9, 7, 0, 6], [6, 2, 4, 6], [2, 2, 0, 1]]]
1666
+ [[[4.281963231653285, 7.6564706580977155, 2.7831005401808904, 4.69275453971821], [7.731377457312142, 7.026081604862776, 3.1623746844355916, 4.097454457127405], [1.0053860355938644, 8.396390096875859, 5.860124932392565, 0.7556741321519111]], [[3.0505373562186717, 5.846422325897977, 5.79128924014881, 5.322513543793011], [7.97334322055796, 0.4266873959996582, 6.217219949795519, 2.819046997201407], [7.195256735457888, 3.205909055908082, 2.9903485221015123, 6.695032815286013]]]
1546
1667
  """
1547
1668
 
1548
- print(regression.linear_regression(list(range(5)), [2, 4, 6, 7, 8]))
1549
- print(regression.parabolic_regression(list(range(5)), [2, 4, 6, 7, 8]))
1550
- print(regression.polynomial_regression(list(range(5)), [2, 4, 6, 7, 8], 4))
1669
+ print(regression.lin_reg(list(range(5)), [2, 4, 6, 7, 8]))
1670
+ print(regression.par_reg(list(range(5)), [2, 4, 6, 7, 8]))
1671
+ print(regression.poly_reg(list(range(5)), [2, 4, 6, 7, 8], 4))
1551
1672
 
1552
1673
  """
1553
1674
  [1.5, 2.4000000000000004]
1554
1675
  [-0.21428571428571563, 2.3571428571428625, 1.971428571428569]
1555
- [0.0833333333480164, -0.6666666668091551, 1.416666667838451, 1.1666666648311779, 2.0000000002900586]
1676
+ [0.08333333333320592, -0.666666666666571, 1.4166666666628345, 1.1666666666688208, 1.9999999999999258]
1556
1677
  """
1557
1678
 
1558
1679
  print(tools.classify([1, 2.3, 4 + 5j, "string", list, True, 3.14, False, tuple, tools]))