Skip to main content

Largest triangle three buckets module for Python written in C

Project description

lttbc: Largest-Triangle-Three-Buckets (Python using a c implementation)

This is a low-level implementation of the Largest-Triangle-Three-Buckets (LTTB) downsampling algorithm written in Python.

The code has been translated from the work of Sveinn Steinarsson (https://github.com/sveinn-steinarsson/flot-downsample/).

Known features and requirements:

  • The algorithm requires monotonically increasing x data (finite)
  • The algorithm requires finite y data (otherwise problems might occur)
  • x and y data have to be of same length (of course)
  • The algorithm returns arrays of dtype double

How to use on the field

The module lttbc differs in the standard input from other largest triangle three buckets implementations. The downsample function takes an input for x and y in addition to the threshold:

import lttbc
import numpy as np

ARRAY_SIZE = 10000
THRESHOLD = 1000

x = np.arange(ARRAY_SIZE, dtype=np.int32)
y = np.random.randint(1000, size=ARRAY_SIZE, dtype=np.uint64)

nx, ny = lttbc.downsample(x, y, THRESHOLD)

assert len(nx) == THRESHOLD
assert len(ny) == THRESHOLD
assert nx.dtype == np.double
assert ny.dtype == np.double

# List data or a mixture is accepted as well ...
x = list(range(ARRAY_SIZE))
y = [np.random.uniform(0, 1000) for _ in range(ARRAY_SIZE)]

assert isinstance(x, list)
assert isinstance(y, list)

nx, ny = lttbc.downsample(x, y, THRESHOLD)

assert len(nx) == THRESHOLD
assert len(ny) == THRESHOLD
assert nx.dtype == np.double
assert ny.dtype == np.double

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

lttbc-0.2.1.tar.gz (93.6 kB view details)

Uploaded Source

Built Distributions

lttbc-0.2.1-cp311-cp311-win_amd64.whl (10.1 kB view details)

Uploaded CPython 3.11Windows x86-64

lttbc-0.2.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl (8.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.5+ x86-64

lttbc-0.2.1-cp310-cp310-win_amd64.whl (10.1 kB view details)

Uploaded CPython 3.10Windows x86-64

lttbc-0.2.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (8.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.5+ x86-64

lttbc-0.2.1-cp39-cp39-win_amd64.whl (10.3 kB view details)

Uploaded CPython 3.9Windows x86-64

lttbc-0.2.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (8.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.5+ x86-64

lttbc-0.2.1-cp38-cp38-win_amd64.whl (10.3 kB view details)

Uploaded CPython 3.8Windows x86-64

lttbc-0.2.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (25.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ x86-64

lttbc-0.2.1-cp37-cp37m-win_amd64.whl (10.3 kB view details)

Uploaded CPython 3.7mWindows x86-64

lttbc-0.2.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (25.5 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.5+ x86-64

lttbc-0.2.1-cp36-cp36m-win_amd64.whl (10.3 kB view details)

Uploaded CPython 3.6mWindows x86-64

lttbc-0.2.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (24.5 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.5+ x86-64

File details

Details for the file lttbc-0.2.1.tar.gz.

File metadata

  • Download URL: lttbc-0.2.1.tar.gz
  • Upload date:
  • Size: 93.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.9.11

File hashes

Hashes for lttbc-0.2.1.tar.gz
Algorithm Hash digest
SHA256 8ee634437b8a265d73de758bb81354aee4206698caa0e65fdd33568dc2373d47
MD5 5e33e43df8ab42978fdb6a6cf14c81bd
BLAKE2b-256 52cde2967ba6757a614c9b8ff103c82b8c05e5a3ac88fb263283a73042e48920

See more details on using hashes here.

File details

Details for the file lttbc-0.2.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: lttbc-0.2.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for lttbc-0.2.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a8ea47ef09c4ff40f7efe5cd6b31f7d63bfd1492ef7d7a61e96fe775e18369ac
MD5 74c510517249ae5ae66114611b9df173
BLAKE2b-256 98c98640162447420baa36f6b4cfa2a0589c780351f14649167f358000473d1d

See more details on using hashes here.

File details

Details for the file lttbc-0.2.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lttbc-0.2.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 96a4be0ac595f3a92d74cbbf2c00f17a8e84954b0f0ad39b9b0aa5b842c2dfdb
MD5 5c6dc0ed47c1e6ad948c3163b42fd246
BLAKE2b-256 06484938c22ea734577a6081b42f29c1e75f19e3a8e5848a548f7465a668c0ce

See more details on using hashes here.

File details

Details for the file lttbc-0.2.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: lttbc-0.2.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for lttbc-0.2.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cbdc07c9d76e84256827de473a009d7b721d6b724a33052639646e1bbaf583b1
MD5 b7178ab4b61fc2becce31fc97e9e820e
BLAKE2b-256 60dae991941296990cf142eb43d07866efa272352cbabc067f502c0983e0b57f

See more details on using hashes here.

File details

Details for the file lttbc-0.2.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: lttbc-0.2.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: CPython 3.10, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for lttbc-0.2.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4f24e24139a8a298844bde492bbade13d710330b118756e4359072df80c7b2b6
MD5 f9146e515d40f58323d6320d29662b31
BLAKE2b-256 6152bfe8672c89407cd273eece1477b7c964fe1c3f700ab189a6a67197fd1569

See more details on using hashes here.

File details

Details for the file lttbc-0.2.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: lttbc-0.2.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.9.11

File hashes

Hashes for lttbc-0.2.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 398d8df1073094764508c15be585bdaab99040e7c202c802aaebae7f4649ff41
MD5 cc350d51b3ecde4b1917eb8afe49a48e
BLAKE2b-256 5b011dd7f31840dc5e755a205abc6d35a2f28ad081e59e187bce8dd5b07175f4

See more details on using hashes here.

File details

Details for the file lttbc-0.2.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lttbc-0.2.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f17d786b893562fb748d66f32f82036291b8534fc2a00c127dde4010b0223728
MD5 4f319c5dcd16c32dbea6d3603d10f175
BLAKE2b-256 707dc91d68eec3c1dfa4f57e1536f17e4a84b5b13c3cc9a101a0474e13ca731b

See more details on using hashes here.

File details

Details for the file lttbc-0.2.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: lttbc-0.2.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.9.11

File hashes

Hashes for lttbc-0.2.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 29db756d674b6ed3e5e190b354962c654da774f78607dbdfc69bd891e9087efc
MD5 8f66085beb1492e022ff2b5c05a7b64c
BLAKE2b-256 9caef7cd09c17caa6b6e78dee01c3ed01b44905115fcd225564217f16c55ea00

See more details on using hashes here.

File details

Details for the file lttbc-0.2.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lttbc-0.2.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 03fbec70af032edc49f12c36ce46686a63e0b5f2bb1ecd8a61f9cf8c0a08c1c7
MD5 afce370c4ec8ae18b03de8d1e495376c
BLAKE2b-256 ce04ed97296d044eda7f9e4d928e881c81d287e354349b5790dc5de24c2a00a8

See more details on using hashes here.

File details

Details for the file lttbc-0.2.1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: lttbc-0.2.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.9.11

File hashes

Hashes for lttbc-0.2.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 40f2947abcea2824bd8357208e4e637959145a9b985c804cf8164efa105a52c0
MD5 bb9e8082f3bdc7c908bd71f241f0277f
BLAKE2b-256 d1f566ebd1ff650ea14da7d35c4e108ddc0c4827c303acd4a86d74f23f8fba1d

See more details on using hashes here.

File details

Details for the file lttbc-0.2.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lttbc-0.2.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 940f104feffb1c2f5bca79911a84dccd20ec05a6b6c543cc92d1bb9ed0b9f726
MD5 6b39d2919738fd000e4aef9783cd0b6c
BLAKE2b-256 ddf2b7fcc12af119b980ad7108e2a4b5c62f7cb31419c1eba5958b592e982d03

See more details on using hashes here.

File details

Details for the file lttbc-0.2.1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: lttbc-0.2.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.9.11

File hashes

Hashes for lttbc-0.2.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 5fa960f03a5a069fafde816ca3ba007436b10568eac422f627d11e756965cfea
MD5 86251ba0319b1df88dfe165779225412
BLAKE2b-256 3e842c8657a05c495931e1cc3163c1c26d08aa39c3c233a8256f4fced6d9691e

See more details on using hashes here.

File details

Details for the file lttbc-0.2.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lttbc-0.2.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5a2ed72bb400bd99aef25db1bc533cc2c0a077e301283fa1f11ce9e9938aa8ba
MD5 d66b41974c280ed90fca217a7d6a4547
BLAKE2b-256 9bc5bab77f6cac6b4dd14064b34ebeb5853948913ec89cb5487706f2a4906df2

See more details on using hashes here.

Supported by

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