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.2.3.tar.gz (246.3 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.2.3-cp311-cp311-win_amd64.whl (302.7 kB view details)

Uploaded CPython 3.11Windows x86-64

dtw_python-1.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (666.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

dtw_python-1.2.3-cp311-cp311-macosx_10_9_x86_64.whl (314.0 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

dtw_python-1.2.3-cp310-cp310-win_amd64.whl (303.4 kB view details)

Uploaded CPython 3.10Windows x86-64

dtw_python-1.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (645.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

dtw_python-1.2.3-cp310-cp310-macosx_10_9_x86_64.whl (315.0 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

dtw_python-1.2.3-cp39-cp39-win_amd64.whl (303.8 kB view details)

Uploaded CPython 3.9Windows x86-64

dtw_python-1.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (648.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

dtw_python-1.2.3-cp39-cp39-macosx_10_9_x86_64.whl (314.3 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

dtw_python-1.2.3-cp38-cp38-win_amd64.whl (313.3 kB view details)

Uploaded CPython 3.8Windows x86-64

dtw_python-1.2.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (661.4 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

dtw_python-1.2.3-cp38-cp38-macosx_10_9_x86_64.whl (322.0 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

dtw_python-1.2.3-cp37-cp37m-win_amd64.whl (312.2 kB view details)

Uploaded CPython 3.7mWindows x86-64

dtw_python-1.2.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (633.7 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

dtw_python-1.2.3-cp37-cp37m-macosx_10_9_x86_64.whl (322.5 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

dtw_python-1.2.3-cp36-cp36m-win_amd64.whl (321.6 kB view details)

Uploaded CPython 3.6mWindows x86-64

dtw_python-1.2.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (634.7 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

dtw_python-1.2.3-cp36-cp36m-macosx_10_9_x86_64.whl (322.3 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: dtw-python-1.2.3.tar.gz
  • Upload date:
  • Size: 246.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for dtw-python-1.2.3.tar.gz
Algorithm Hash digest
SHA256 0e756636bb715d00ead568eccd5b4d18057610446162400f7e26a1a27e003ce8
MD5 de7abfd0a3626bcedf315caf5ace48ad
BLAKE2b-256 fcfb7a50a6e70a3286412757b5e52d12101e3d783818acba59269e34a907a2d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.2.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 302.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for dtw_python-1.2.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 67171515501115222e2fd292742c7c6454daff49c7c8570ec25b0428fe01e960
MD5 69211b8a6be9d10d9c878de98ad55257
BLAKE2b-256 e1e7c37c1d2f86c94444d6b0086b8fb3d0d1fa3dff10cbbd5a9f53c4732b3029

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 94417026b8e1249b11b9a24bcf8216fb2ca8e9454308210776cdcd60a564917f
MD5 4af607bba66894bf8bf96eba26a87ef3
BLAKE2b-256 9c2f06a31e70ce62170454510cb0b5442487ac53cd74fc3b022252f0f631a36f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.2.3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 514bbab3825d2c2a475e6f7ab5d080e5de8d29526c1734203bb3b1ece899bcad
MD5 fe077acb76c51dab721af5e3ea568cde
BLAKE2b-256 7bc9cb11ef75df985023b786769d7d7ffa9aeb5353e20d833cefb82c82bfbc28

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.2.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 303.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for dtw_python-1.2.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 996f2bcfa481c8850f598740944b5f9dc008179db2eedefe66ca7fbff6a075f5
MD5 bc7e6bca964efe235d8c9017e0663d9d
BLAKE2b-256 c10ad979193d0f65a475c03ebd340a8b0d804390dbb476e76dee61c07cea3da5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 88b980695c1cd37f788dad7dcd0f0bcc2cd74b2c5650eea74bec8ac58fddd7c8
MD5 d05316abdf814280e427d1ee93f66b5d
BLAKE2b-256 ce9b2f14fb868e07f0cde59eecb3b3dc0097b54ebe1077fe497a3210a8799cc6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.2.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 078c6b2d151be1d23601ad151ba2042d1efcb840749d813b2604e0cb8783d2ee
MD5 3a26a74b606a77734405235b84d33907
BLAKE2b-256 0132cdba15363c611f52ca3d697b75f0fd6f9a51d0fe0f444af13359b9319af8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.2.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 303.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for dtw_python-1.2.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 295bc942c8a9b66106b103df9c0b0608f24ef16fed307d5b3ba53297a9b91f25
MD5 a8c6c7d114616615319dcb07fc77771e
BLAKE2b-256 18e7828d167e6b131446505dca73c57ba66dcef9603b7a5daf2d90816b2d73bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 953e1a1e8a33664a30c8f2bc2411d8ea0670388ddeeaf00cd6c55db939701867
MD5 4bab0ef003989a0b5ae2367a984818b7
BLAKE2b-256 90321e29ba8f5e335a5750575aea4a42dc10cd7a01dbefa17979dc7aa84c2db3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.2.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 88496b7a0b820fb1d34f0d33fac47527d1a6f1ec3c4d0eefd56ce33f1f5e1a43
MD5 c36da365c5af2e8454f485e42c2f019a
BLAKE2b-256 c2ec23aa8317c9bab2160bd0899887ccfa240d2631d25cc138ec161d03050b97

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.2.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 313.3 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for dtw_python-1.2.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 21e62fb796ec95741b43a92ec880a876562349890b8476b2b6f834138b65b99a
MD5 fa147d66802b8e54bd186ac7662e56a5
BLAKE2b-256 da4c62ae8647fa8554c7c6734a8988689a78b8738c94bcc24ac49948d8658593

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.2.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9552cc3c78e25fab3286bf88bf8acdf673c23a454eaef9424fd1d2e29e3d009d
MD5 87c69d571730920db1954034dae0a915
BLAKE2b-256 5a17e8f65cb4753bf74371b1b5e05afba60a6cdcf1ea5a26a251805e0d4fcf19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.2.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f39548da2190065cec41e4a715f4733354a19be179abd5c287ac12b9ef9fb0db
MD5 72ad46565d6ab86a217c148b2dac4397
BLAKE2b-256 9670adca1ffc5c951b3588111a952f70562496abc18f0168ae5885b1b22eaf2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.2.3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 312.2 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for dtw_python-1.2.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 379b98343938ed38ae42e6105c541eab9c1e474580c23a3be3f45d0c1b4706b3
MD5 5dc4be4fe153e05ac5ffd55c6da7b019
BLAKE2b-256 de5c53c65f308ced422731b52e96d4e01639cc182d4c81e44ed7c62cf4d5eade

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.2.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc93ad1443f00960a5292402758758447222344d8e834099e28567ed8c807bbf
MD5 08b6cf1f9ed03039c622df3cc660d0b9
BLAKE2b-256 b568d534773cd7bff9f40639af2c80addb3638895c748fbb8d88e623d77b3521

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.2.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1de8b3898cc55ae6b6371f9711194db4c78e8549cc11b894376fd75a75409a88
MD5 f5d4d3974df4297402ca9f1c2c96328a
BLAKE2b-256 24b1c665688eb35c220f8af16b0642344d6165ab726b0beb00c527964cbad190

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.2.3-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 321.6 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for dtw_python-1.2.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 cdcd8092f0215ca290fd43a1802d39bebce17250c47bb0affacdf930edcceeac
MD5 5f28d17ff82680b60f89301d379af53e
BLAKE2b-256 9bb6ce7b52a9edb057edf908344fe9f9bbbce0b3ca8de61a9eb3e03d73b73651

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.2.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 90e76b8edb6059676c3b7b9c774548793493f796594cd00fa76d1662677e59b8
MD5 3df030e8380ec672f08218f0b38d102b
BLAKE2b-256 3095afa3495129381858afcf7823c57eac54e2c7774537cef04d5f8a3e0c8b9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.2.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 28d4eb947899131a910cada5e89d9395d189d1ea63d97b6d9ebd9a027a86031a
MD5 d8767c4033cf8f28cab31f3a316645ad
BLAKE2b-256 f808d78753b378ee3f16b251be782d026d3742396d77de23f1c2a8e6358bbafd

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