Installing scikits.bootstrap (version 0.3.1) using easy install (Python 3.3 on Windows 7) ran through, despite reporting a syntax error (referring to line “except TypeError, e”). However, importing failed (“ImportError: No module named ‘bootstrap’”). The following few things have to be fixed for bootstrap to run under Python 3.3: scikits\bootstrap\__init.py__ line 1: from .bootstrap import * …
Category Archive: Python
Jul
19
Simple Moving Average Filter in Python
Just a simple moving average filter implementation as Python class, nothing more. class MovingAverageFilter: """Simple moving average filter""" @property def avg(self): """Returns current moving average value""" return self.__avg def __init__(self, n = 8, initial_value = 0): """Inits filter with window size n and initial value""" self.__n = n self.__buffer = [initial_value/n]*n self.__avg = …