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.3.0.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.3.0-cp311-cp311-win_amd64.whl (302.8 kB view details)

Uploaded CPython 3.11Windows x86-64

dtw_python-1.3.0-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.3.0-cp311-cp311-macosx_10_9_x86_64.whl (314.0 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

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

Uploaded CPython 3.10Windows x86-64

dtw_python-1.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (645.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10macOS 10.9+ x86-64

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

Uploaded CPython 3.9Windows x86-64

dtw_python-1.3.0-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.3.0-cp39-cp39-macosx_10_9_x86_64.whl (314.3 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

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

Uploaded CPython 3.8Windows x86-64

dtw_python-1.3.0-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.3.0-cp38-cp38-macosx_10_9_x86_64.whl (322.0 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

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

Uploaded CPython 3.7mWindows x86-64

dtw_python-1.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (633.8 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.7mmacOS 10.9+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

dtw_python-1.3.0-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.3.0-cp36-cp36m-macosx_10_9_x86_64.whl (322.4 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: dtw-python-1.3.0.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.3.0.tar.gz
Algorithm Hash digest
SHA256 2285012dc92c4744b78683d82439b279fd759b1005e702b62d03cbaa044f532b
MD5 45ad50863609189712ceeabd5b6b7aed
BLAKE2b-256 1ea7ba25778edd0a087f49cb1450512c42756ef519cb0f00508738c5461727fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 302.8 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.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1f07a933eaa7e533c51211e0015e17553002a1cfbca3fae826869403c8a22d64
MD5 339be8ffd61fcd57086e3179e5c4a043
BLAKE2b-256 54ec82d29c7e39be2d74a3e540ce84a2d5e0432626cf0320aa8496d2af578013

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1857e6d3fba82a2f03caf0d721edac71d4f956674172e6898aee3e09f91f98d7
MD5 dcd7670a65a3da18ab5a8bb1b11466b1
BLAKE2b-256 9bbdb95eddb66c1c523539ae854c9eac1a94afb0c23f09100ab2dd3e5268e532

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.3.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 67cb6400add4301c069656f09ff368d4fe4d2ed865fd0693df5317d63ff851de
MD5 199d20e091436587721098c558d8f458
BLAKE2b-256 a97f432fc0780677e45de9998eda0f21daa29f9e63e78ed4bfbddaeb1c1f0ffb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.3.0-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.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fcff0042d541a56b97ab9b583f907ba49e0283358ec0543c0cc2a2f6eaea8489
MD5 b3f2bf514186d5bed2f9b9f1682c0e6f
BLAKE2b-256 03ae440ec4dea059d110ec3cb690418357a1dcefbec391c1bc4dfb8c3cf805be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 90b8e637903cb03ed470ee279dee9727aa39abfd857aa3b91aa83c29dcc04d18
MD5 6e21f3ccacee82d648621aa37e76b22d
BLAKE2b-256 68b9e419a30ef7f7fd1008470faf99fd3802591e7985346affffe4636b2c605c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.3.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cced1148e2977abd0e650c4593a4b544c47d3de5b71160cfad7069c2ad94d717
MD5 54fc18320708e9c9e8f450b04e4f063d
BLAKE2b-256 66e72218055d9614fed9549de5a6274908e390673905efd3db58922a67f03117

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.3.0-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.3.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 57573f0f675fb2d1442e840fd3b846e5e115d38ca5651c14e652abdaac45c6e4
MD5 34cdf78deacc7d51f5473e0ed3ebc4e2
BLAKE2b-256 c4be9c021f15ecf960f500e67ede23bd789a8ce0d58d534c04880099a9710c7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 29a2bd8cfe3ef90589bceeaa8e6b9b5d708101511a883dc6b96e80b85716a059
MD5 6bc74da2279404d44dce30aedf3316f9
BLAKE2b-256 56e0a91d6cfdbcc1f158e05f0770eef855a72300d99e223c7a3ede81faf3021d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.3.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 59fbe57734bdfc93fe3044cbbe7cb3054a0c8039c2c91dd55245525e5498f191
MD5 4a4ebdbbb7d78c2ad8a2c7627773b970
BLAKE2b-256 d02b4cdf0fc4016a85460715286b1cd37062f2cad49d1c18211b5b61070fbf9a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.3.0-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.3.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 cae70b9ffc77f68648681690fa1b0985a5db9ebeda347f22bd3d4a98a19312e2
MD5 5c3577f0917fc5c3d2ab58684cb2e0c6
BLAKE2b-256 1a054881e2a8ebe0c19d82d77842944f8fa8a5336ec585cdae0b61d5abf64ac0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8aa7935e87e5c0ea0d6d4e83c657d118ea7475e23b2ceb8a1dfa288b88af79ff
MD5 0212def337eacbbdc593d74f21af06c6
BLAKE2b-256 6b44c82e1476287617cab453dfba65bbf5357b7fd92a0dc1e193f191e82fb79b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.3.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1b5dc53f3c5f2bc96925612c3b43e055d11ab9fd17dbe105c8b6cfefc12711db
MD5 d26547b465cc6fd4cb6dba6e496d5d39
BLAKE2b-256 5726e2dfaf5702c9b9ae0916d898296804ee1c503c7293c672901c00aac8107e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.3.0-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.3.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 3d9940117b0f0f7bae924921f3d48ffbdb1016f38c413f0165326d4af8824d97
MD5 140a3f7eaf80b15181e17d372562e55b
BLAKE2b-256 0da7c4277d87645c9854d3e642dd5e2ddefc2cc2f906067a44ee1d443da580c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 594186d91a0c736a0bec65ef22a796bfcd3bb94b09a66deff2b10d8e369c694a
MD5 a8b9c1f11c9c75e1966f391efd849f6a
BLAKE2b-256 db91b63aedebcad09efcf5d76d4c1e6ac4598c9d05d9d8f153a90c34aff5d756

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.3.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 903085c996bd6e775b77774a6c4bbaa5a27f84184793eeb0724f6ea63d775a57
MD5 6cc2deab58b68883a94cdf40c92f6ad8
BLAKE2b-256 7725b4f48d4693206e473cde0b6afacfbcf91f476f66c93a0abf5f636446da71

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.3.0-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.3.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 9da342e1cb86448416dd89b7f9685579604e42ba732db78f898f44071ade8629
MD5 2ebd61980ff758f70d918117e3aaf70e
BLAKE2b-256 07827d8b1d95b34a47818f9db735bdaac110cb7bd6f107488ef690d206fdf560

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9950c4f8a387e8fc79d32e049a6a5f9ecb2fb7fc86ffc349b26b06323ceb89d4
MD5 55de453d1db1eb690c5648d184779487
BLAKE2b-256 de8aa52dcdf45c4029f8b599ecb9e1e28190219797858a6eb206f2259ae19f2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.3.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 259b5e4ce573cdbe3a5e214dbc76c3f3198623578e70beb7dc09ac79e05ffb92
MD5 598db14894d5d00aacf1d704e46dec0a
BLAKE2b-256 8be5ba7e7db19f15bf0d04934a3d1f2e6392621a9d351ca9ccef9e334c0c7cfa

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