Metadata-Version: 2.4
Name: mingmath
Version: 0.4.1
Summary: A Python package for undergraduate mathematics, including Calculus, Linear Algebra, Data Structures, Recursion, OOP, Scientific Computing, File I/O, Data Visualization, Graph Theory, and Advanced Mathematics.
Author-email: Thayapan <m.thayapan@gmail.com>
License: MIT
License-File: LICENSE
Keywords: calculus,data structures,gmpy2,linear algebra,mathematics,matplotlib,networkx,numpy,oop,pandas,pari,plotly,pyvista,recursion,sagemath,scipy,seaborn,sympy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Education
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.8
Requires-Dist: cypari2
Requires-Dist: gmpy2
Requires-Dist: matplotlib
Requires-Dist: networkx
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: plotly
Requires-Dist: pyvista
Requires-Dist: scipy
Requires-Dist: seaborn
Requires-Dist: sympy
Description-Content-Type: text/markdown

# MingMath

MingMath is a Python package for undergraduate mathematics and mathematical computing.

## Installation

```bash
pip install mingmath
```

```python
import mingmath
```

## 1. String Processing

ใช้สำหรับจัดการข้อความ เช่น การกลับข้อความและการนับจำนวนสระ

```python
print(mingmath.reverse_string("MingMath"))
print(mingmath.count_vowels("MingMath"))

# Output:
# htaMgniM
# 2
```

## 2. List

ใช้สำหรับจัดการข้อมูลแบบ List และคำนวณผลรวมของสมาชิก

```python
numbers = [1, 2, 3, 4, 5]
print(mingmath.list_sum(numbers))

# Output:
# 15
```

## 3. Tuple

ใช้สำหรับจัดการข้อมูลแบบ Tuple และสามารถแปลง Tuple เป็น List ได้

```python
data = (1, 2, 3)
print(mingmath.tuple_to_list(data))

# Output:
# [1, 2, 3]
```

## 4. Dictionary

ใช้สำหรับจัดการข้อมูลแบบ Dictionary ซึ่งเก็บข้อมูลในรูปแบบ key-value

```python
student = {"name": "Ming", "year": 2}
print(mingmath.dictionary_keys(student))

# Output:
# ['name', 'year']
```

## 5. Set

ใช้สำหรับจัดการข้อมูลแบบ Set และดำเนินการ Union และ Intersection

```python
a = {1, 2, 3}
b = {3, 4, 5}

print(mingmath.set_union(a, b))
print(mingmath.set_intersection(a, b))

# Output:
# {1, 2, 3, 4, 5}
# {3}
```

## 6. Positional Arguments

แสดงการส่งค่าให้ฟังก์ชันตามลำดับของพารามิเตอร์

```python
print(mingmath.positional_arguments(10, 20))

# Output:
# 30
```

## 7. Keyword Arguments

แสดงการส่งค่าให้ฟังก์ชันโดยระบุชื่อพารามิเตอร์

```python
print(mingmath.keyword_arguments(name="Ming", age=20))

# Output:
# Ming is 20 years old.
```

## 8. Default Arguments

ใช้ค่าเริ่มต้นของพารามิเตอร์เมื่อผู้ใช้ไม่ได้กำหนดค่าเอง

```python
print(mingmath.default_arguments(5))
print(mingmath.default_arguments(5, 3))

# Output:
# 25
# 125
```

## 9. Variable-length Arguments

ใช้สำหรับรับจำนวนอาร์กิวเมนต์ได้หลายค่าในฟังก์ชันเดียว

```python
print(mingmath.variable_length_args(1, 2, 3, 4, 5))

# Output:
# 15
```

## 10. Recursive Function

ใช้ฟังก์ชันเรียกตัวเองเพื่อแก้ปัญหา เช่น Factorial และ Fibonacci

```python
print(mingmath.factorial_recursive(5))
print(mingmath.fibonacci_recursive(6))

# Output:
# 120
# 8
```

## 11. Memoization

ใช้เก็บผลลัพธ์ที่คำนวณไว้แล้ว เพื่อลดการคำนวณซ้ำใน Recursive Function

```python
print(mingmath.fibonacci_memo(10))

# Output:
# 55
```

## 12. Algorithm Comparison

เปรียบเทียบการหาเส้นทางสั้นที่สุดด้วย BFS สำหรับกราฟไม่มีน้ำหนัก และ Dijkstra สำหรับกราฟที่มีน้ำหนัก

```python
edges = [
    ("A", "B"),
    ("B", "C"),
    ("A", "C")
]

print(mingmath.shortest_path_bfs(edges, "A", "C"))

# Output:
# ['A', 'C']


weighted_edges = [
    ("A", "B", 4),
    ("B", "C", 2),
    ("A", "C", 10)
]

print(mingmath.shortest_path_dijkstra(
    weighted_edges, "A", "C"
))

# Output:
# ['A', 'B', 'C']
```

## 13. Class

ใช้ Class และ Object เพื่อสร้างโครงสร้างข้อมูลสำหรับตัวเลข

```python
number = mingmath.Number(10)

print(number.value)
print(number)

# Output:
# 10
# Number(10)
```

## 14. Magic Methods

ใช้ Magic Methods เช่น `__add__` เพื่อกำหนดพฤติกรรมของ Object เมื่อใช้เครื่องหมาย `+`

```python
a = mingmath.Number(10)
b = mingmath.Number(5)

print(a + b)

# Output:
# Number(15)
```

## 15. Inheritance

แสดงการสืบทอดคุณสมบัติจาก Class แม่ไปยัง Class ลูก

```python
number = mingmath.PositiveNumber(10)

print(number.value)
print(number.is_positive())

# Output:
# 10
# True
```

MingMath also demonstrates multiple, multilevel, hierarchical, and hybrid inheritance.

## 16. File I/O

ใช้สำหรับเขียนและอ่านข้อมูลจากไฟล์ข้อความ

```python
mingmath.write_text_file(
    "example.txt",
    "Hello MingMath!"
)

print(mingmath.read_text_file("example.txt"))

# Output:
# Hello MingMath!
```

## 17. Exception Handling

ใช้จัดการข้อผิดพลาดที่อาจเกิดขึ้นระหว่างการทำงานของโปรแกรม

```python
try:
    mingmath.factorial_recursive(-1)
except ValueError as error:
    print(error)

# Output:
# n must be non-negative
```

## 18. NumPy

ใช้ NumPy สำหรับการคำนวณข้อมูลเชิงตัวเลข

```python
numbers = [1, 2, 3, 4, 5]
print(mingmath.numpy_mean(numbers))

# Output:
# 3.0
```

## 19. Pandas

ใช้ Pandas สำหรับสร้างและจัดการข้อมูลในรูปแบบ DataFrame

```python
data = {
    "score": [80, 90, 70],
    "age": [19, 20, 19]
}

df = mingmath.create_dataframe(data)
print(df)

# Output:
#    score  age
# 0     80   19
# 1     90   20
# 2     70   19
```

## 20. SciPy

ใช้ SciPy สำหรับการคำนวณทางวิทยาศาสตร์และคณิตศาสตร์

```python
print(mingmath.scipy_mean([1, 2, 3, 4, 5]))

# Output:
# 3.0
```

## 21. SymPy

ใช้ SymPy สำหรับการคำนวณทางคณิตศาสตร์เชิงสัญลักษณ์ เช่น การหาอนุพันธ์

```python
print(mingmath.sympy_derivative("x**3 + 2*x"))

# Output:
# 3*x**2 + 2
```

## 22. SageMath

ใช้ตรวจสอบและเรียกใช้งานความสามารถของ SageMath

```python
print(mingmath.sage_available())

# Output:
# True
```

SageMath must be installed separately.

## 23. PARI/GP

ใช้ PARI/GP สำหรับการคำนวณทางทฤษฎีจำนวน เช่น Factorial และ GCD

```python
print(mingmath.pari_factorial(5))
print(mingmath.pari_gcd(24, 18))

# Output:
# 120
# 6
```

## 24. GMPY2

ใช้ GMPY2 สำหรับการคำนวณจำนวนเต็มและเลขความแม่นยำสูง

```python
print(mingmath.high_precision_factorial(10))

# Output:
# 3628800
```

## 25. Matplotlib

ใช้ Matplotlib สำหรับสร้างกราฟทางคณิตศาสตร์

```python
x = [1, 2, 3, 4]
y = [1, 4, 9, 16]

mingmath.plot_line(x, y)

# Output:
# Creates a line graph.
```

## 26. Seaborn

ใช้ Seaborn สำหรับสร้างกราฟและแสดงความสัมพันธ์ของข้อมูล

```python
x = [1, 2, 3, 4]
y = [2, 4, 3, 5]

mingmath.plot_scatter(x, y)

# Output:
# Creates a scatter plot.
```

## 27. Plotly

ใช้ Plotly สำหรับสร้างกราฟแบบ Interactive

```python
x = ["A", "B", "C"]
y = [10, 20, 15]

mingmath.plot_bar(x, y)

# Output:
# Creates an interactive bar chart.
```

## 28. NetworkX

ใช้ NetworkX สำหรับสร้างและวิเคราะห์กราฟและเครือข่าย

```python
edges = [
    ("A", "B"),
    ("B", "C")
]

graph = mingmath.create_graph(edges)

print(mingmath.graph_degrees(edges))

# Output:
# {'A': 1, 'B': 2, 'C': 1}
```

## 29. PyVista

ใช้ PyVista สำหรับสร้างและแสดงผลข้อมูลสามมิติ

```python
import numpy as np

x = np.linspace(-2, 2, 10)
y = np.linspace(-2, 2, 10)

X, Y = np.meshgrid(x, y)
Z = X**2 + Y**2

mingmath.show_3d_surface(X, Y, Z)

# Output:
# Creates a 3D mathematical surface.
```

## Version

**0.4.1**

## License

MIT License