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.1.zip
(3.5 kB
view details)
File details
Details for the file numpy_ringbuffer-0.1.1.zip
.
File metadata
- Download URL: numpy_ringbuffer-0.1.1.zip
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9523368eae3a0d8439da9bdd634f50bfbabde21fc2174e04d4d735064fa87a4 |
|
MD5 | b335d0426d8092dbb2cbaf5a05bb9d46 |
|
BLAKE2b-256 | 2f58a06127a1c6b9f090f309aea6c5cf85f3bb45a4ca6cf1c000b509029684e1 |