Ring buffer implementation for numpy
Project description
Circular buffers (aka ring buffers) backed by a numpy array, supporting the operations:
b.append(val)
b.appendleft(val)
b.pop(val)
b.popleft(val)
np.array(b) - fast unwrapping into a numpy array, for vectorization
For example:
import numpy as np
from numpy_ringbuffer import RingBuffer
r = RingBuffer(capacity=4, dtype=np.bool)
r.append(True)
r.appendleft(False)
print(np.array(r)) # array([False, True])
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
numpy_ringbuffer-0.1.0.zip
(3.6 kB
view details)
File details
Details for the file numpy_ringbuffer-0.1.0.zip
.
File metadata
- Download URL: numpy_ringbuffer-0.1.0.zip
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cb3245eb30d269249fcc9c67a566e59b88fb3c1b8733f127d75db55ea13c0e6 |
|
MD5 | a028d203e616f370d4f7b7a7edeb783f |
|
BLAKE2b-256 | 6460833361d0ce0fc21d1b6b5294ebb546d40da8fcf70244fbb5bce5e91a7eac |