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

This version

0.4.0

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.4.0.tar.gz (122.9 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.4.0-cp38-cp38-win_amd64.whl (37.7 kB view details)

Uploaded CPython 3.8Windows x86-64

libpymath-0.4.0-cp38-cp38-manylinux1_x86_64.whl (101.5 kB view details)

Uploaded CPython 3.8

libpymath-0.4.0-cp38-cp38-manylinux1_i686.whl (100.6 kB view details)

Uploaded CPython 3.8

libpymath-0.4.0-cp38-cp38-macosx_10_9_x86_64.whl (35.4 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

libpymath-0.4.0-cp37-cp37m-manylinux1_x86_64.whl (100.6 kB view details)

Uploaded CPython 3.7m

libpymath-0.4.0-cp37-cp37m-manylinux1_i686.whl (99.8 kB view details)

Uploaded CPython 3.7m

libpymath-0.4.0-cp37-cp37m-macosx_10_9_intel.whl (57.7 kB view details)

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

libpymath-0.4.0-cp36-cp36m-manylinux1_x86_64.whl (100.6 kB view details)

Uploaded CPython 3.6m

libpymath-0.4.0-cp36-cp36m-manylinux1_i686.whl (99.8 kB view details)

Uploaded CPython 3.6m

libpymath-0.4.0-cp36-cp36m-macosx_10_9_intel.whl (57.7 kB view details)

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

libpymath-0.4.0-cp35-cp35m-manylinux1_x86_64.whl (100.6 kB view details)

Uploaded CPython 3.5m

libpymath-0.4.0-cp35-cp35m-manylinux1_i686.whl (99.8 kB view details)

Uploaded CPython 3.5m

libpymath-0.4.0-cp35-cp35m-macosx_10_9_intel.whl (57.7 kB view details)

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

File details

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

File metadata

  • Download URL: libpymath-0.4.0.tar.gz
  • Upload date:
  • Size: 122.9 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.4.0.tar.gz
Algorithm Hash digest
SHA256 e85f61c53f83899173d5567efd8d56e5155fd9b2bf3c883314a7b69a0119ea35
MD5 5bd51f753cada09f32bd30cd4685d22f
BLAKE2b-256 8acb5e60058bc0617a634c16377c4ab2afddecaad855263e32d3a5d3694f1317

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 37.7 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.4.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 59d58e4846056141d0988e793edd43df57b223c50dfe9e39d65e5be219282535
MD5 dba5665170a0ca7fcfda69dcaeaadff0
BLAKE2b-256 2d7fe1ca1500899055ddfb64ea52656dd96cd43aebf79be3c109ef5e074918ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 101.5 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.4.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3ce6c04f8c8309ca7cbe113d583795a063fa5932865c94e2f092b5552ed9d17e
MD5 547abbeaafdb32b719239d310a71fe65
BLAKE2b-256 a430934e2e81d937f697ff051f04a6ea240c7a87dc0a66c4770b2321f8731b3b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp38-cp38-manylinux1_i686.whl
  • Upload date:
  • Size: 100.6 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.4.0-cp38-cp38-manylinux1_i686.whl
Algorithm Hash digest
SHA256 f8d69353b88ff72c2aa256b271eaac9953d7e3f321e4e1ca387d1c1cd54fefd9
MD5 ac5e900d2ad20e6a2b99711e59251d88
BLAKE2b-256 1ab2d1e8a1108bce13ef100d4817ba6b34282c036c441073846cb7fa97007e3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 35.4 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.4.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3d0d7d8f04a24dbc7c074ed7b8c12373cbebad1e6939ebef8960aed178ea34ae
MD5 343f5876f781ea445650b4688095eb8b
BLAKE2b-256 aa7cb86aa3b537e937c30b9a04e979fe5e241101855c9fc976ee4e4839e4969f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 100.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.4.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bd74499a02d4d5a3f1522caa2f089417009b3be20d11a01958065fdbc032e1b2
MD5 7e4dcbbabc675ad968a1c610d32233a7
BLAKE2b-256 46d31aac854723ea51b273eee5ad426afc661f3687e3f4583192b235e1cbb354

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 99.8 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.4.0-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 4ef9f389d95e492adaf6e50e803b92f5c8576a5ab166dcece45ad899e1f191e4
MD5 5066683efc0dbd55557b839c97ec8790
BLAKE2b-256 ed1f6f132c941bd8cc1a799ba8a231731564840c346e4da44707254b6785455f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp37-cp37m-macosx_10_9_intel.whl
  • Upload date:
  • Size: 57.7 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.4.0-cp37-cp37m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 fccbefe96a06f8d0746062330039360f0b09a215d51d80cc28f73454d4469dd3
MD5 e39a147d0d60b8d0faf9c74c455eb32f
BLAKE2b-256 6fcd787c1f4926d60b630cfab9e100c2bdad14c0fcde313eb50bf92e7f2f2545

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 100.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.4.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7c78d4ae108e5b93b25f840dec977ed7efa5caed88acf467b9b64e088f006eba
MD5 0fc7a52c243916fdae817187b6adc3a0
BLAKE2b-256 35f87afee659664b84d155480eb96d71d8c0c59a23385fa2b869eb2256d55260

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 99.8 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.4.0-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 54df73dd4b9b72240c3677487649ce2ebc9e39a6ceb0374205dfd715f0084bd6
MD5 85db066a05ae5ceaf8e721f7404fc493
BLAKE2b-256 dc7c2eefa7ee87734269380fcc4776f87d7ab306a89a95873ee6b04abcc76ab8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp36-cp36m-macosx_10_9_intel.whl
  • Upload date:
  • Size: 57.7 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.4.0-cp36-cp36m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 7bb8bddef1c2ac9f1719e8c0cdabd0add87f58f3f7258af4fe5e7c0ee608209b
MD5 48696380dc0da1dd7bca19f1e0f70f16
BLAKE2b-256 7d528a599b95bedb6b48a91f6c23994777f35b5250baee54af0cf0ce92b2223c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 100.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.4.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e5e8a490a7fdb9fb9ccc518148c408e2dd80f8e9ee1d55bf8e2e4071ad648190
MD5 4e50b5296bc2aa017356bd1907cb541b
BLAKE2b-256 b3a082fd9ac17b99928108c04260eadda5f556fb74e7f625aa5fefdb02cbfafa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp35-cp35m-manylinux1_i686.whl
  • Upload date:
  • Size: 99.8 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.4.0-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 7a0b6a9ef73316f25bdf858e561b481f3929fbd5a677889cc6a8d852b75a8d8e
MD5 6bf7ade1fd8f2d05f559970a54007126
BLAKE2b-256 54154b3c8af90b0d00b757239cbe68a026fb462b6ebccfba7b263cb7434fefe4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libpymath-0.4.0-cp35-cp35m-macosx_10_9_intel.whl
  • Upload date:
  • Size: 57.7 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.4.0-cp35-cp35m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 24e6d1102322f1fff3de34b47d2495e4d14bafd75a81569cc239918247c2f44b
MD5 95a6328e1537c014675b085576157e5b
BLAKE2b-256 0058835b6cbfc268a02e5eadd236f6a1476e53059ec93c54b915a38c9c26c1e3

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