by slaypni

slaypni / fastdtw

A Python implementation of FastDTW

446 Stars 79 Forks Last release: Not found MIT License 32 Commits 8 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


Python implementation of

_ [1]_, which is an approximate Dynamic Time Warping (DTW) algorithm that provides optimal or near-optimal alignments with an O(N) time and memory complexity.



pip install fastdtw



import numpy as np from scipy.spatial.distance import euclidean

from fastdtw import fastdtw

x = np.array([[1,1], [2,2], [3,3], [4,4], [5,5]]) y = np.array([[2,2], [3,3], [4,4]]) distance, path = fastdtw(x, y, dist=euclidean) print(distance)


.. [1] Stan Salvador, and Philip Chan. "FastDTW: Toward accurate dynamic time warping in linear time and space." Intelligent Data Analysis 11.5 (2007): 561-580.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.