Skip to main content

A comprehensive implementation of dynamic time warping (DTW) algorithms. DTW computes the optimal (least cumulative distance) alignment between points of two time series. Common DTW variants covered include local (slope) and global (window) constraints, subsequence matches, arbitrary distance definitions, normalizations, minimum variance matching, and so on. Provides cumulative distances, alignments, specialized plot styles, etc.

Project description

Comprehensive implementation of Dynamic Time Warping algorithms.

DTW is a family of algorithms which compute the local stretch or compression to apply to the time axes of two timeseries in order to optimally map one (query) onto the other (reference). DTW outputs the remaining cumulative distance between the two and, if desired, the mapping itself (warping function). DTW is widely used e.g. for classification and clustering tasks in econometrics, chemometrics and general timeseries mining.

This package provides the most complete, freely-available (GPL) implementation of Dynamic Time Warping-type (DTW) algorithms up to date. It is a faithful Python equivalent of R’s DTW package on CRAN. Supports arbitrary local (e.g. symmetric, asymmetric, slope-limited) and global (windowing) constraints, fast native code, several plot styles, and more.

https://github.com/DynamicTimeWarping/dtw-python/workflows/Build%20and%20upload%20to%20PyPI/badge.svg https://badge.fury.io/py/dtw-python.svg https://codecov.io/gh/DynamicTimeWarping/dtw-python/branch/master/graph/badge.svg

Documentation

Please refer to the main DTW suite homepage for the full documentation and background.

The best place to learn how to use the package (and a hopefully a decent deal of background on DTW) is the companion paper Computing and Visualizing Dynamic Time Warping Alignments in R: The dtw Package, which the Journal of Statistical Software makes available for free. It includes detailed instructions and extensive background on things like multivariate matching, open-end variants for real-time use, interplay between recursion types and length normalization, history, etc.

To have a look at how the dtw package is used in domains ranging from bioinformatics to chemistry to data mining, have a look at the list of citing papers.

Note: R is the prime environment for the DTW suite. Python’s docstrings and the API below are generated automatically for the sake of consistency and maintainability, and may not be as pretty.

Features

The implementation provides:

  • arbitrary windowing functions (global constraints), eg. the Sakoe-Chiba band and the Itakura parallelogram;

  • arbitrary transition types (also known as step patterns, slope constraints, local constraints, or DP-recursion rules). This includes dozens of well-known types:

  • partial matches: open-begin, open-end, substring matches

  • proper, pattern-dependent, normalization (exact average distance per step)

  • the Minimum Variance Matching (MVM) algorithm (Latecki et al.)

In addition to computing alignments, the package provides:

  • methods for plotting alignments and warping functions in several classic styles (see plot gallery);

  • graphical representation of step patterns;

  • functions for applying a warping function, either direct or inverse;

  • a fast native (C) core.

Multivariate timeseries can be aligned with arbitrary local distance definitions, leveraging the [proxy::dist](https://www.rdocumentation.org/packages/proxy/versions/0.4-23/topics/dist) (R) or [scipy.spatial.distance.cdist](https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.cdist.html) (Python) functions.

Citation

When using in academic works please cite:

    1. Giorgino. Computing and Visualizing Dynamic Time Warping Alignments in R: The dtw Package. J. Stat. Soft., 31 (2009) doi:10.18637/jss.v031.i07.

When using partial matching (unconstrained endpoints via the open.begin/open.end options) and/or normalization strategies, please also cite:

    1. Tormene, T. Giorgino, S. Quaglini, M. Stefanelli (2008). Matching Incomplete Time Series with Dynamic Time Warping: An Algorithm and an Application to Post-Stroke Rehabilitation. Artificial Intelligence in Medicine, 45(1), 11-34. doi:10.1016/j.artmed.2008.11.007

Source code

Releases (stable versions) are available in the dtw-python project on PyPi. Development occurs on GitHub at <https://github.com/DynamicTimeWarping/dtw-python>.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

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

dtw-python-1.4.2.tar.gz (276.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dtw_python-1.4.2-cp312-cp312-win_amd64.whl (355.3 kB view details)

Uploaded CPython 3.12Windows x86-64

dtw_python-1.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (769.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

dtw_python-1.4.2-cp312-cp312-macosx_10_9_x86_64.whl (364.7 kB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

dtw_python-1.4.2-cp311-cp311-win_amd64.whl (354.9 kB view details)

Uploaded CPython 3.11Windows x86-64

dtw_python-1.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (782.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

dtw_python-1.4.2-cp311-cp311-macosx_10_9_x86_64.whl (364.5 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

dtw_python-1.4.2-cp310-cp310-win_amd64.whl (354.8 kB view details)

Uploaded CPython 3.10Windows x86-64

dtw_python-1.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (744.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

dtw_python-1.4.2-cp310-cp310-macosx_10_9_x86_64.whl (364.5 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

dtw_python-1.4.2-cp39-cp39-win_amd64.whl (354.6 kB view details)

Uploaded CPython 3.9Windows x86-64

dtw_python-1.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (745.6 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

dtw_python-1.4.2-cp39-cp39-macosx_10_9_x86_64.whl (364.4 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

dtw_python-1.4.2-cp38-cp38-win_amd64.whl (355.3 kB view details)

Uploaded CPython 3.8Windows x86-64

dtw_python-1.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

dtw_python-1.4.2-cp38-cp38-macosx_10_9_x86_64.whl (364.1 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

dtw_python-1.4.2-cp37-cp37m-win_amd64.whl (354.6 kB view details)

Uploaded CPython 3.7mWindows x86-64

dtw_python-1.4.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (718.3 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

dtw_python-1.4.2-cp37-cp37m-macosx_10_9_x86_64.whl (364.8 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

dtw_python-1.4.2-cp36-cp36m-win_amd64.whl (365.4 kB view details)

Uploaded CPython 3.6mWindows x86-64

dtw_python-1.4.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (710.0 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

dtw_python-1.4.2-cp36-cp36m-macosx_10_9_x86_64.whl (362.4 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

Details for the file dtw-python-1.4.2.tar.gz.

File metadata

  • Download URL: dtw-python-1.4.2.tar.gz
  • Upload date:
  • Size: 276.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for dtw-python-1.4.2.tar.gz
Algorithm Hash digest
SHA256 69df1335a70ed6b8abe00b21c2dd79fcc0d56c21998520a275f566a787d05d50
MD5 99020c165dbc698ab61c1022383f83cb
BLAKE2b-256 7264204784d1583c6e888ef032fad735c7cff47d993d4b1c52fa541cccb97757

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: dtw_python-1.4.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 355.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for dtw_python-1.4.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8b48597e5a194fbe2dbdc5fac5d3cd8008c369975a73a1771dd1d5c036c7978a
MD5 163d86dad4020b92756111ac1a5f8a18
BLAKE2b-256 77f4186692b9441b20aafac2d246f22290d420637ecec9c8ae7513670515221b

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f146f222ba2be471b9968dd33e743f1b1f3903d9b529a478aaeb8c07b8f026fe
MD5 7fe982f87469119ae0ca11aa7f74cb92
BLAKE2b-256 496cd09fcd0ac2e279a447b28cfa3a68ed3a4322b8bb7b1662da602dd0738b6c

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5eb9e1a933deb17f068ec52b6d99dba472ba2fb7311e1fa31dc90fb526d07efa
MD5 0b96cd06ee257215d81834a8c35fd533
BLAKE2b-256 4e98bec1d1932bb3ce6b08085ae27bf9ada1bc4b162b6d138904e478344a78f6

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: dtw_python-1.4.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 354.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for dtw_python-1.4.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a067d21ce2ecd2eb1a0d04587d03acb212cc68db64b955abfd7895db75e34fe1
MD5 66c39b09e3998ada7e4e6dcd3830e627
BLAKE2b-256 881c5c794aa719cdd85c748eeacfffd700dadf50b0701d31805dba6e17ba7c4b

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c30c0f0da300d56ceac8bfbbe4b914e0364565a85af4b4dee4a562135e21461c
MD5 04b5537e93cbc123ccbaec28451e9914
BLAKE2b-256 23c71e6e6dee06b13f82c4be6ba5c45d66b4ba264b4fd271e44fd8db3625be6c

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b6ec09a27011eb620bdaa926e4969ff28245beac9db2ce5938eccf12b316e514
MD5 3d12b8db93a34c0f9ea5ad45b7eef34e
BLAKE2b-256 12182dc225082648b23ee65eaa8c5d97910e5910c8cf8847ece2967d5db0270f

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: dtw_python-1.4.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 354.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for dtw_python-1.4.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cfebbf77a21e50c691967a8a2e07f2687d4ed5c05e2655f04e4df0be4efad021
MD5 7ee3b7e2fb457b2969d133c694d864b8
BLAKE2b-256 169c00c9d94ca7bd7636e9a3ff0d31a6a1618e88669eceec674ef3e549cddf5b

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6a8ceca93a47aa39549e7b9dca7d37fa6c083c3ade32ec75da47b6b1481ae636
MD5 b8111f0084aa4ee3186fece1953fbe70
BLAKE2b-256 c857a5fe26afda19c7f7251f44b163db28487f7dd034625b9b4a6fd9a7175276

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 327b8c08d4c2881dc02fab05a8bbbd0a895e6440c33306dda8aad2fc870497cb
MD5 6fc3559afed05925c187f226964d5723
BLAKE2b-256 6a3b517bb96058b514145b8c0d970f739f8ecbebedde25153a569f9d4d323da4

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: dtw_python-1.4.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 354.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for dtw_python-1.4.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 58fb6026ed616956b8f6ef02b32fcaf0a7e16653042862d5799ecce581431a92
MD5 6d18e1de114be7ad7dcacb653ad7ecbe
BLAKE2b-256 20194cf00be1ec226c808fc71134e6974af39663aa001ea32b1474680f501bbd

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 77757c04af8398b450ff77b6f6568797980ffeda882a8f2a3d436945356ab070
MD5 78b98220b65ae7ece8a7055098fcc2e9
BLAKE2b-256 4ebaa7052d335b2735bc9f9b378505d963545289e468e3fd6b1d3d79c14ceaba

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a9dba5ac327dd556181b2bb5a572e77d8efc296e12183e4ee488bc62a9b548de
MD5 33bd72b747df2da4f3210e9d02c66bf7
BLAKE2b-256 823552c558c258e9fead52af6c3e8f054ec65d51399d40f45db3924b4c12c317

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: dtw_python-1.4.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 355.3 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for dtw_python-1.4.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b4bfadf599e0ced248391afb8b95c688d11f7807db3f57c1b7a7e9d72381d486
MD5 b7c78a1ed9ffa9f2b363a0c04ef5370e
BLAKE2b-256 710befb00995f5c475f7de0e65b5216bc98838d49842d4549f041fe81cba0c2f

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 87a2ee836cb9f4ce33dbfc1a42f6b613330c54f5717d320155fedd5276ee5763
MD5 c0e193af420dbd885d11423f560251c0
BLAKE2b-256 408ef652d7675796658319066465cf19b432b54742c1d0e7e3c182bc1b90f00c

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4f3dca863cd3ae57ea6a04b2383512c050ace850e828f29dce561e9673517345
MD5 66d78271ebbac1fc1a86ef95b12cf08c
BLAKE2b-256 6bcb30682dde274304fb954264308ec528c5b8b8ada9022f2f216d4522ce7fab

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: dtw_python-1.4.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 354.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for dtw_python-1.4.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 1c949e6d712cadcfb1c7f7e201dee2d022edb9df8063857cb5d013c2ed1738b0
MD5 5d063e728d7242f949ff9472a551552e
BLAKE2b-256 36ace15154f0e933158dbd1150f8714ef22da8098fa426877c90fe78d94f29ab

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 72cf20f8e55affb41ab8eb6221bb96450315bbf82fcc8593baea477d13e250ce
MD5 7733cada4e4f9ac24ba8935465157aa0
BLAKE2b-256 6bdbf039e62d95eedce6f4b7ef7c64441455d51e9c6ea0b4f77583e4bbb53cef

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5702a154c7f41b95ae2e2c9e76f4a19b8d51989a0116f81802de77b05ab0aee6
MD5 02f71301e6c91956ca317581f7edbe30
BLAKE2b-256 63be39620e08bb67a1f3ad94644dca2d3387cc5999d296907ac691a44f7630c4

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: dtw_python-1.4.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 365.4 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for dtw_python-1.4.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 a8181198d2dd6f8f4212ac290349be1d7bdf4cfbc38e9d5f42f540e74d5cb0f5
MD5 f9afc02ff9de8ef46c6f8c97f5e7f9dd
BLAKE2b-256 04d415804b279eaa7a2bc7351fd6eca7c4a81ec50b2fb7ebf996d38678e1561e

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f8ef887727ff2940c218b9251ba66d6c2b6a58f41d59024bb83bc572fd3ef8db
MD5 5190a83fee67837853968e6b0fcc8814
BLAKE2b-256 e95379c39dbd7056fa39259197cc781a200f34df66a6b398eabc3ccfc5b195a3

See more details on using hashes here.

File details

Details for the file dtw_python-1.4.2-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dtw_python-1.4.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 92ea7b346afb1792495e1ea1477785c01d11a7cf8cb252a1c5189a1c8d1936c8
MD5 4fbc12a1aeeedb4f409bf7aa042edea4
BLAKE2b-256 7f9816c6dc64c67a6b82e014bc223cd40e2c409876d82f068ce3dab4f3ef827e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page