Skip to main content

A general purpose Python math module

Project description

Build Status Documentation Status PyPI version fury.io PyPI license PyPI pyversions Downloads per month

LibPyMath

A fast, general purpose math library for Python


Install

Run pip install libpymath to dowload and install libpymath for your system. There are also wheels provided for many of the latest Python versions on Windows, Mac OS* and Linux thanks to the cibuildwheel project.


Features and usage

Matrix math

Easily create, manipulate and perform calculations with dense matrices. The matrices themselves are stored and manipulated with optimised C code, resulting in faster operations and more efficient calculations. To further increase the speed of the calculations, when libpymath imported into a project for the first time, it runs some tests on the CPU to find the optimal number of threads to use for the matrix calculations.

The matrix library is currently in its early stages and only supports elementwise addition, subtraction, division and multiplication, as well as the matrix transpose function and some ease of use functions, such as the ability to format and print a matrix, alligning the decimal points (if present) and providing brackets in the relevant places.

For example, the following creates a new matrix from a 2d list of data

# Import the Matrix object from the matrix library
from libpymath.matrix import Matrix

# Create the data
matrixData = [[1, 2, 3],
              [4, 5, 6],
              [7, 8, 9]]

# Produce a new Matrix with the data
mat = Matrix(data=matrixData)

# Print the matrix
print(mat)

>>> [[1.0, 2.0, 3.0]
     [4.0, 5.0, 6.0]
     [7.0, 8.0, 9.0]]

Here is another example to show the formating abilities of libpymath's matrix type. The decimal points, commas and brackets are all alined on a per-row basis, saving space and producing a nicer result.

# Create the data
matrixData = [[1, 2, 3.14159],
              [4, 5000, 6],
              [7, 8, 9]]

# Produce a new Matrix with the data
mat = Matrix(data=matrixData)

# Print the matrix
print(mat)

>>> [[1.0,    2.0, 3.14159]
     [4.0, 5000.0, 6.0    ]
     [7.0,    8.0, 9.0    ]]

The example below shows what happens when printing a large matrix, as the entire thing could not fit on the screen -- libpymath shows only the corners, missing out the middle section of the matrix on both the x and y axis, allowing large matrices to be printed quickly and using a small amount of space.

# Create the data for a 1000x1000 matrix
rows = 1000
cols = 1000
matrixData = [[j + i * cols for j in range(rows)] for i in range(cols)]

# Produce a new Matrix with the data
mat = Matrix(data=matrixData)

# Print the matrix
print(mat)

>>> [[     0.0,      1.0,      2.0  ***     997.0,    998.0,    999.0]
     [  1000.0,   1001.0,   1002.0  ***    1997.0,   1998.0,   1999.0]
     [  2000.0,   2001.0,   2002.0  ***    2997.0,   2998.0,   2999.0]
           ***       ***       ***            ***       ***       ***  
     [997000.0, 997001.0, 997002.0  ***  997997.0, 997998.0, 997999.0]
     [998000.0, 998001.0, 998002.0  ***  998997.0, 998998.0, 998999.0]
     [999000.0, 999001.0, 999002.0  ***  999997.0, 999998.0, 999999.0]]

* Due to Clang on Mac OS the wheels do not support OpenMP, meaning some matrix operations may be slower than on other operating systems.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

libpymath-0.3.12.tar.gz (122.7 kB view details)

Uploaded Source

Built Distributions

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

libpymath-0.3.12-cp38-cp38-win_amd64.whl (37.6 kB view details)

Uploaded CPython 3.8Windows x86-64

libpymath-0.3.12-cp38-cp38-manylinux1_x86_64.whl (101.3 kB view details)

Uploaded CPython 3.8

libpymath-0.3.12-cp38-cp38-manylinux1_i686.whl (100.4 kB view details)

Uploaded CPython 3.8

libpymath-0.3.12-cp38-cp38-macosx_10_9_x86_64.whl (35.2 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

libpymath-0.3.12-cp37-cp37m-manylinux1_x86_64.whl (100.4 kB view details)

Uploaded CPython 3.7m

libpymath-0.3.12-cp37-cp37m-manylinux1_i686.whl (99.6 kB view details)

Uploaded CPython 3.7m

libpymath-0.3.12-cp37-cp37m-macosx_10_9_intel.whl (57.6 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ Intel (x86-64, i386)

libpymath-0.3.12-cp36-cp36m-manylinux1_x86_64.whl (100.4 kB view details)

Uploaded CPython 3.6m

libpymath-0.3.12-cp36-cp36m-manylinux1_i686.whl (99.6 kB view details)

Uploaded CPython 3.6m

libpymath-0.3.12-cp36-cp36m-macosx_10_9_intel.whl (57.6 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ Intel (x86-64, i386)

libpymath-0.3.12-cp35-cp35m-manylinux1_x86_64.whl (100.4 kB view details)

Uploaded CPython 3.5m

libpymath-0.3.12-cp35-cp35m-manylinux1_i686.whl (99.6 kB view details)

Uploaded CPython 3.5m

libpymath-0.3.12-cp35-cp35m-macosx_10_9_intel.whl (57.6 kB view details)

Uploaded CPython 3.5mmacOS 10.9+ Intel (x86-64, i386)

File details

Details for the file libpymath-0.3.12.tar.gz.

File metadata

  • Download URL: libpymath-0.3.12.tar.gz
  • Upload date:
  • Size: 122.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for libpymath-0.3.12.tar.gz
Algorithm Hash digest
SHA256 129fb8b78c8d39137b05f528b413529cdbcdcf48e2647f6d04193cf14b134e7c
MD5 6f79c8139c7411303bf421b13a74ead7
BLAKE2b-256 6676a714e736a896787cbcc50e2235e3fd1e7beee52d19f6c2c95c6e92feb162

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for libpymath-0.3.12-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2c405178addf0da929b093c68da70e16718172ea7b651ae1d29b393d6d25491a
MD5 c1ee8747ac0ebb0fbb2de2d6d67b8ab5
BLAKE2b-256 d69bd83b576b4bf9227034e881767f37692ab44988e1b9482b25e9a0a26ba630

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 101.3 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.7

File hashes

Hashes for libpymath-0.3.12-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 57ae31e7692968c0380ec53b3f884f593d7e73cda2d7ef06896ed055fa21e9f8
MD5 047c7ed0efc35ba61acffe190998c88d
BLAKE2b-256 6bbf77399df337328f2587959dd3e7bb0c29f55bbcaca4ba28c59d17e7d0842f

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp38-cp38-manylinux1_i686.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp38-cp38-manylinux1_i686.whl
  • Upload date:
  • Size: 100.4 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.7

File hashes

Hashes for libpymath-0.3.12-cp38-cp38-manylinux1_i686.whl
Algorithm Hash digest
SHA256 015ae54e3ef8c6f42e17f421afced824b7b20f8a034cf18212de1535e8d3b7b2
MD5 547edfa2885b7a8d2dcd481472f6d373
BLAKE2b-256 c97241ac624763c4c1a2618603759f80123fe75099b19d3d371f5c41eab4ae72

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.0

File hashes

Hashes for libpymath-0.3.12-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 481228adccb2f57594f8129e30740259459d2314bc0a0dc631c727d658354b0b
MD5 17bfa65f466de69e25f389e1ce693d96
BLAKE2b-256 81b7ac65cdd7890491ebed943749e4c2ea2d773f6eea23cadf64bb2a700d92fe

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 100.4 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.7

File hashes

Hashes for libpymath-0.3.12-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2dc866565068363d421d9307fe1e975df9db8cddc201eb1fc7c42b99e0a16b77
MD5 5e2691a1e48458953fde59871cfb14ae
BLAKE2b-256 f07cd9c20c65e91db373d8038599e3f19dbbbb829415bb7b4146e7f9b6c5e4ba

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp37-cp37m-manylinux1_i686.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 99.6 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.7

File hashes

Hashes for libpymath-0.3.12-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 43777a227b6da7a0e68a33ed1ed5b7b8b825df9331b3715b3c386803cade4d23
MD5 9a852ec900004d8d80e94af8d00dd5a4
BLAKE2b-256 750d390ab99b362e487fb681b0b11a89fd16401a77a0b66cb52a23c89be16164

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp37-cp37m-macosx_10_9_intel.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp37-cp37m-macosx_10_9_intel.whl
  • Upload date:
  • Size: 57.6 kB
  • Tags: CPython 3.7m, macOS 10.9+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.0

File hashes

Hashes for libpymath-0.3.12-cp37-cp37m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 5655baf8c61a3f2d6be1a0c545e4f60a329a626195dfdfa788fc6c4dccfd073a
MD5 0eb6e45ba900144df20588922f774586
BLAKE2b-256 caf4ff844b260c369eecad3111d6e5538c76c946ab0c21c09bad684d36bceca1

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 100.4 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.7

File hashes

Hashes for libpymath-0.3.12-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e6f8e72cef60b500d2a6128e45b30c54c58375171770b05b9aa4a32c4c3f9cd5
MD5 2be43f95b0b581e4cdc902ec1eba0019
BLAKE2b-256 a17b3bf3301c37f45df9f2213cd29b19b0cc7a52fa819fd8c2c59611702b387e

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp36-cp36m-manylinux1_i686.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 99.6 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.7

File hashes

Hashes for libpymath-0.3.12-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 d8138760a053b7ee4444d5742132c7dd5670f354d7b57a15185db38bbe4efede
MD5 8b65e8cba34edc7d69ff2fd72c8ec98a
BLAKE2b-256 8012fdd6b8ddeff518286ff110e73e4858d2d3b4236806cb77b86323deaa9646

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp36-cp36m-macosx_10_9_intel.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp36-cp36m-macosx_10_9_intel.whl
  • Upload date:
  • Size: 57.6 kB
  • Tags: CPython 3.6m, macOS 10.9+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.0

File hashes

Hashes for libpymath-0.3.12-cp36-cp36m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 5ec89f4fdf1d9f06a6c674f4c7c0ec813faf1b45d868034b03ba4605c6d8a74b
MD5 409518b128bc7cf3c34a1c816b926025
BLAKE2b-256 c7a1e591b0a3466e94c0790a79727d78185a64a075ff187dd13cc67c79889914

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 100.4 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.7

File hashes

Hashes for libpymath-0.3.12-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f09e85af6f49667e76444597c026251c4fcffcf70e9ed2d991254f33f6da641b
MD5 823004f7e1e2fc7acb70bb645c0c0b54
BLAKE2b-256 ff25b498d58bf953543a33cc6c527620a0bc9c32cd022b533d264dba7bbc60b4

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp35-cp35m-manylinux1_i686.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp35-cp35m-manylinux1_i686.whl
  • Upload date:
  • Size: 99.6 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.7

File hashes

Hashes for libpymath-0.3.12-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 04ca0e53717b4ef8d3d7426a5e56becff8c55f5b5be9110d5716c061bc02af71
MD5 161fdf667f863c8dee94e3de7c19eb5a
BLAKE2b-256 ba40b6b3b1eeea0da254c17ce588d56e41c81b21c6f55b5d23100677cb806542

See more details on using hashes here.

File details

Details for the file libpymath-0.3.12-cp35-cp35m-macosx_10_9_intel.whl.

File metadata

  • Download URL: libpymath-0.3.12-cp35-cp35m-macosx_10_9_intel.whl
  • Upload date:
  • Size: 57.6 kB
  • Tags: CPython 3.5m, macOS 10.9+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.0

File hashes

Hashes for libpymath-0.3.12-cp35-cp35m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 f391f4b44d9d94e874591f83e091c7e623ce96613e794b46382200e7ecd369f5
MD5 bdcc0715ed8a9a6d3dd878f9ee1f9c31
BLAKE2b-256 8d4a9f689d2059641a75f5e5943d32c5385a97b37bd0d5175a229c3916b78998

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 Pingdom Monitoring Sentry Error logging StatusPage Status page