Skip to main content

Math & Stats Tools (My-package)

ตัวอย่าง Python Package มาตรฐาน PEP 517/621 สำหรับคำนวณด้านทฤษฎีจำนวนและสถิติเบื้องต้น

การใช้งาน

import my_package as pkg

# ==========================================
# 1. ทดสอบฟังก์ชันด้านทฤษฎีจำนวน (Number Theory)
# ==========================================
print("=== Number Theory Functions ===")

# ตรวจสอบจำนวนเฉพาะ
print("is_prime(17):", pkg.is_prime(17))
print("is_prime(20):", pkg.is_prime(20))

# หา ห.ร.ม. และ ค.ร.น.
print("gcd(48, 18):", pkg.gcd(48, 18))
print("lcm(4, 6):", pkg.lcm(4, 6))

# คำนวณ แฟกทอเรียล (5!)
print("factorial(5):", pkg.factorial(5))

# ตรวจสอบจำนวนสมบูรณ์
print("is_perfect_number(28):", pkg.is_perfect_number(28))
print("is_perfect_number(10):", pkg.is_perfect_number(10))


# ==========================================
# 2. ทดสอบฟังก์ชันด้านสถิติ (Statistics)
# ==========================================
print("\n=== Statistics Functions ===")

sample_data = [2, 4, 4, 4, 5, 5, 7, 9]

# คำนวณค่าเฉลี่ยเลขคณิต
print("mean:", pkg.mean(sample_data))

# คำนวณค่ามัธยฐาน
print("median:", pkg.median(sample_data)) 

# คำนวณฐานนิยม (คืนค่าเป็น list)
print("mode:", pkg.mode(sample_data))   

# คำนวณความแปรปรวนแบบประชากร
print("variance:", pkg.variance(sample_data))

# คำนวณส่วนเบี่ยงเบนมาตรฐานแบบประชากร
print("std_dev:", pkg.std_dev(sample_data))

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mathbyart-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mathbyart-0.1.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file mathbyart-0.1.0.tar.gz.

File metadata

  • Download URL: mathbyart-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.15

File hashes

Hashes for mathbyart-0.1.0.tar.gz
Algorithm Hash digest
SHA256 74c40503ad45e14a44b5d4b04b40fd9e3829350ab79f8a3f7bae31670a00667c
MD5 c2251c0d0fadcb25fe4c1b8b80d65758
BLAKE2b-256 71421fe066077d5ab881cddcb830fc652de206c4d38b601b1561b6a1aba89aa8

See more details on using hashes here.

File details

Details for the file mathbyart-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mathbyart-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.15

File hashes

Hashes for mathbyart-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 917b3c3111243e0aa07ed00a9d9b2330e6f007c0a5181da5620942ee05ebf056
MD5 a5681ca26bde6be550253faf295a4e80
BLAKE2b-256 5f0c0b9b33b6af921b249ba745ec8799167678f35cbd90eecc1b51d695a56b77

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page