Skip to content

udaypatel1/ewma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EWMA

Python Version

A lightweight, streaming-friendly Exponentially Weighted Moving Average (EWMA) library for Python.
Designed for real-time metrics, analytics, and streaming data.


Features

  • Streaming / online updates in O(1) time and memory
  • Configurable smoothing factor (alpha)
  • Optional initial value
  • Reset and reuse EWMA instances
  • Fully tested with pytest
  • Type hints for modern Python (>=3.9)

Usage

from ewma import EWMA

# Create an EWMA instance
ewma = EWMA(alpha=0.2)

# Stream data
for x in [10, 20, 30]:
    print(ewma.update(x))

# Access current value
print("Current EWMA:", ewma.value())

# Reset
ewma.reset(initial_value=5.0)

Installation

From GitHub

pip install git+https://github.com/udaypatel1/ewma.git

About

Utility for Exponential Weighted Moving Average

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages