Skip to main content

Arrays of numbers for Python, optimized for small sizes

Project description

Tinyarrays are similar to NumPy arrays, but optimized for small sizes. Common operations on very small arrays are to 3-7 times faster than with NumPy (with NumPy 1.6 it used to be up to 35 times), and 3 times less memory is used to store them. Tinyarrays are useful if you need many small arrays of numbers, and cannot combine them into a few large ones. (The resulting code is still much slower than C, but it may now be fast enough.)

Unlike Python’s built-in tuples, Tinyarrays support mathematical operations like element-wise addition and matrix multiplication. Unlike Numpy arrays, Tinyarrays can be used as dictionary keys because they are hashable and immutable. What is more, tinyarrays are equivalent to tuples with regard to hashing and comparisons: a dictionary or set with tinyarray keys may by transparently indexed by tuples.

The module’s interface is a subset of that of NumPy and thus should be familiar to many. Whenever an operation is missing from Tinyarray, NumPy functions can be used directly with Tinyarrays.

Project details


Download files

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

Source Distribution

tinyarray-1.2.4.tar.gz (38.0 kB view details)

Uploaded Source

File details

Details for the file tinyarray-1.2.4.tar.gz.

File metadata

  • Download URL: tinyarray-1.2.4.tar.gz
  • Upload date:
  • Size: 38.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for tinyarray-1.2.4.tar.gz
Algorithm Hash digest
SHA256 ecd3428fd8a48b61fc5f0a413ede03e27db3a1dd53fcd49e24a36d11a8a29aba
MD5 057d0638b98ce172506dfe30fd93866f
BLAKE2b-256 91a2ba2e0b1ccb6261a5df19b2e6b63bbeb7624b32958dd16c9ddf97795c535d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page