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

math_stats_tools-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.

math_stats_tools-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: math_stats_tools-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 math_stats_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 56748ff56c921b226bde02c0ed7c390eff9acbd537e81be2626483d0ca570730
MD5 b64bc3a4a4fd51ae18cf2bf9e91d187d
BLAKE2b-256 7f822958d52971856c0674f3e40e4241d090ba21d17b59013a49700c7a1d1d93

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for math_stats_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4afe856a4a7ef24f6052ef92221c893998a06cf215c1bb0b0de2fe465e9a715
MD5 da16e6b003fa45e93a5c33ff717be383
BLAKE2b-256 f66cbd2628ca3b745e1eef5e5e1fcff248dd02132091f03398436f4cfdd2a807

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