A lib to implement sliding window with overlapping on numpy array
Project description
A python package to run sliding window with overlapping on numpy array
### Status
[](https://travis-ci.org/imravishar/sliding_window)
[](https://pypi.python.org/pypi/window-slider)
[](https://github.com/imravishar/sliding_window/commits/master)
[](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fimravishar%2Fsliding_window?ref=badge_shield)
[](https://pypi.python.org/pypi/window-slider)
[](https://pypi.python.org/pypi/window-slider/)
**Usage**
=========
$ pip install window-slider
$ python
from window_slider import Slider
import numpy
list = numpy.array([0, 1, 2, 3, 4, 5, 6, 7])
bucket_size = 3
overlap_count = 1
slider = Slider(bucket_size,overlap_count)
slider.fit(list)
while True:
window_data = slider.slide()
# do your stuff
print(window_data)
if slider.reached_end_of_list(): break
numpy 2D array
-
from window_slider import Slider
import numpy
list = numpy.array([[0, 1, 2, 3],[0, 1, 2, 3]])
bucket_size = 3
overlap_count = 1
slider = Slider(bucket_size,overlap_count)
slider.fit(list)
while True:
window_data = slider.slide()
# do your stuff
print(window_data)
if slider.reached_end_of_list(): break
wrap window data to custom class
-
class WindowData(object):
def __init__(self, data):
self._data = data
def sum(self):
return sum(self._data)
from window_slider import Slider
import numpy
list = numpy.array([0, 1, 2, 3, 4, 5, 6, 7])
bucket_size = 3
overlap_count = 1
slider = Slider(bucket_size,overlap_count,WindowData)
slider.fit(list)
while True:
window_data = slider.slide()
# do your stuff
print(window_data.sum())
if slider.reached_end_of_list(): break
## License
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fimravishar%2Fsliding_window?ref=badge_large)
### Status
[](https://travis-ci.org/imravishar/sliding_window)
[](https://pypi.python.org/pypi/window-slider)
[](https://github.com/imravishar/sliding_window/commits/master)
[](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fimravishar%2Fsliding_window?ref=badge_shield)
[](https://pypi.python.org/pypi/window-slider)
[](https://pypi.python.org/pypi/window-slider/)
**Usage**
=========
$ pip install window-slider
$ python
from window_slider import Slider
import numpy
list = numpy.array([0, 1, 2, 3, 4, 5, 6, 7])
bucket_size = 3
overlap_count = 1
slider = Slider(bucket_size,overlap_count)
slider.fit(list)
while True:
window_data = slider.slide()
# do your stuff
print(window_data)
if slider.reached_end_of_list(): break
numpy 2D array
-
from window_slider import Slider
import numpy
list = numpy.array([[0, 1, 2, 3],[0, 1, 2, 3]])
bucket_size = 3
overlap_count = 1
slider = Slider(bucket_size,overlap_count)
slider.fit(list)
while True:
window_data = slider.slide()
# do your stuff
print(window_data)
if slider.reached_end_of_list(): break
wrap window data to custom class
-
class WindowData(object):
def __init__(self, data):
self._data = data
def sum(self):
return sum(self._data)
from window_slider import Slider
import numpy
list = numpy.array([0, 1, 2, 3, 4, 5, 6, 7])
bucket_size = 3
overlap_count = 1
slider = Slider(bucket_size,overlap_count,WindowData)
slider.fit(list)
while True:
window_data = slider.slide()
# do your stuff
print(window_data.sum())
if slider.reached_end_of_list(): break
## License
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fimravishar%2Fsliding_window?ref=badge_large)
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
window_slider-0.7.zip
(6.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file window_slider-0.7.zip.
File metadata
- Download URL: window_slider-0.7.zip
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/2.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54ecbecd137faca6a1996d01d87473beab79ad3fdec3afcfb8b1360f6a2b50f0
|
|
| MD5 |
c46e7102439d78590dc90c1aefb51dbc
|
|
| BLAKE2b-256 |
994ae762e749d172186732112ba6a154df47c1cb116e56cc3cfe72cc15b61aae
|
File details
Details for the file window_slider-0.7-py2.py3-none-any.whl.
File metadata
- Download URL: window_slider-0.7-py2.py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/2.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee0ba97e71ab669f2c2afcf55939db67c9fb63777b40281affb698c80e55db8a
|
|
| MD5 |
10427051dd3af95accbfe8d780cbed2a
|
|
| BLAKE2b-256 |
f85754e612206169b5952e459083110f3d330e67f8c26803e2f8489847305492
|