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.4.tar.gz (276.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.4.4-cp312-cp312-win_amd64.whl (355.4 kB view details)

Uploaded CPython 3.12Windows x86-64

dtw_python-1.4.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (770.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

dtw_python-1.4.4-cp312-cp312-macosx_10_9_x86_64.whl (364.8 kB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

dtw_python-1.4.4-cp311-cp311-win_amd64.whl (355.0 kB view details)

Uploaded CPython 3.11Windows x86-64

dtw_python-1.4.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (782.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

dtw_python-1.4.4-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.4-cp310-cp310-win_amd64.whl (354.9 kB view details)

Uploaded CPython 3.10Windows x86-64

dtw_python-1.4.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (744.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

dtw_python-1.4.4-cp310-cp310-macosx_10_9_x86_64.whl (364.6 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

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

Uploaded CPython 3.9Windows x86-64

dtw_python-1.4.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (745.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

dtw_python-1.4.4-cp39-cp39-macosx_10_9_x86_64.whl (364.5 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

dtw_python-1.4.4-cp38-cp38-win_amd64.whl (355.4 kB view details)

Uploaded CPython 3.8Windows x86-64

dtw_python-1.4.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

dtw_python-1.4.4-cp38-cp38-macosx_10_9_x86_64.whl (364.2 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

dtw_python-1.4.4-cp37-cp37m-win_amd64.whl (354.7 kB view details)

Uploaded CPython 3.7mWindows x86-64

dtw_python-1.4.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (718.4 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

dtw_python-1.4.4-cp37-cp37m-macosx_10_9_x86_64.whl (364.9 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

dtw_python-1.4.4-cp36-cp36m-win_amd64.whl (365.5 kB view details)

Uploaded CPython 3.6mWindows x86-64

dtw_python-1.4.4-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.4-cp36-cp36m-macosx_10_9_x86_64.whl (362.5 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

Details for the file dtw_python-1.4.4.tar.gz.

File metadata

  • Download URL: dtw_python-1.4.4.tar.gz
  • Upload date:
  • Size: 276.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for dtw_python-1.4.4.tar.gz
Algorithm Hash digest
SHA256 0439ac944e2d3d0f979afd44acfc3d4e726b167e01119d7421e71c552c57489c
MD5 67f1f59ce47962b7a2809cb32dab3ba7
BLAKE2b-256 9847842d7d17892a3a0eadf8a6443d365bfd04d72a1fbe6f24806ec114f3df69

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dtw_python-1.4.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d38bdbd1fd42b3a44afaf440e304dc9b3b264dd040bbd3b4cca13c367e7eda95
MD5 3c4a59b888f49f67c11ecfb5c72a6267
BLAKE2b-256 d639b9b0b3770e4864d24a8cf47a52ad0db7f498688b880119a961bedd6ad6c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7206b62d94adaabe6fbc8c030c789b8fd897be3363c9df0102f2d67367db0835
MD5 4e8326d4e0f36c4e3296d55daabda38b
BLAKE2b-256 6b6f2ab045d5322cef9d59d5e437510be27c627da9bc5aae3c4156f7bec66649

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a82152d3b92de9fbc0ed4d122cb1c49ced1972ace93ef8c7ba37e994f9cdd938
MD5 2818ddaf2606c876d1aa1a25f2b80d60
BLAKE2b-256 7d39d22979e12dd17685411b710129afc588de30fd5f5d3c093f9844fb72bc91

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dtw_python-1.4.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5ac25b9980aa64bd30e911702b380892ba7ae93be4d4e6d017195b106b5a1c5e
MD5 2371863bae72abf6737a2c1d2210514e
BLAKE2b-256 c9e1ccb031425f0c863a00207817b63339e344b86d8856404d843d930f7ec8aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 38f85e3f475b1820987a6ecff32b8d6db892bd2d3b5f87a2bff075ca56562e0f
MD5 b1e8ecd2a056ab8d3a57fcd88729ec37
BLAKE2b-256 4c3518591df5194bc68ebcec8b78dbe40cca03db3c41a90639d7c2b1d525745a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 73af999a3509650ef5fba54e05c930e4524741b38a728f6428174c4ea1c581e2
MD5 d10a29f9cb87c5ecf0263ab99c3da24f
BLAKE2b-256 5fa05277ea473020972f06f53308a6e8adf03b9d58f0fbc6c188ab7c707d17e3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dtw_python-1.4.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7ab2da51724bac90023283ee26d44ca6d1864d2de0f809e2f2cb0891cbf44541
MD5 496ea463fdb180f39d10713993347dd5
BLAKE2b-256 f60834e53310e293c09fe422dd31c0911e8cba5d7f5ec1b167b036774639f584

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 329c72d06e627bbd60503e51199f9d89441d6d4200e106883750382314625377
MD5 138e7325c6875f6cbc732d6c1c02c537
BLAKE2b-256 e2e020b369be1e8c18d4231bbe315c9afab022bc53cf2ef7a83fbb24663578e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a481781450ec0c35848e2af9d1610aab89902f4c5050a5114ce454014d6a95b6
MD5 2e6a8ad333dd3b5e460acc0df1d84fa5
BLAKE2b-256 b8466d493216575f160e2bebd7337c407b2988c4d6e7be1c070cff86f61c61d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtw_python-1.4.4-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.3

File hashes

Hashes for dtw_python-1.4.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a5e279992ee38ddd0826e2f440aecc945b519e8635188625880774b3e0b9e356
MD5 bc6387de384c3423004b866f1bffa81a
BLAKE2b-256 4165ab617feb6c97979fcc7cb0443ea59ba11331aead8c227b9235b0f3196afe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d943ce73dc3ca00dc8493d6eb1ef0e7ee887185fecbd9e39c1884f3a6cd34d9e
MD5 d85dc8b5d74119f07c70c1a878943f9a
BLAKE2b-256 c9630469a85af642398d80408a33af20ee1a13a1f2323fa55dbe9dc4342484fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b0c5dd8a7e331aeb60cd3e3e429afbee9b202bd50815e1b58c5e6e90d9f8751c
MD5 9f65ec2a8516223823bf14b40d7c670d
BLAKE2b-256 cf581bafef86821e6dcfa58bcbeb8bfaf082e3d185ff5a924ee8c5a4df33381a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dtw_python-1.4.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e7398a659ace07114fb2adc2bc4fcbdb66ec33685b7deee34cbe3a3038c8b1ed
MD5 6998a555867696844283043e53486072
BLAKE2b-256 eb2cb36949102b7ef009f2adc6ee3c1645a496626d129328d204d8027fe627cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6e2f764450f45543bb67a5158248f3c36190cdd9622e2dca55e1b9fbdc39fa63
MD5 452a8032e598e97855486359a4af661f
BLAKE2b-256 56c7e99fa696d4a92a83bfde40e497f966e46a9c5e5f77f51614a5b645965c6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 743ada73769aee2aa5981c0585fdf4700989d66f961dc3cab6979216517157d0
MD5 0c2db190a6f693259037c413db61b70a
BLAKE2b-256 166f8cbd068f50ac26d07004960c06448a7cbb847829ae2c2724164a734311df

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dtw_python-1.4.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 fa3b10b9ce39733717741b83d5516a027d3dfb2b945ee9c9fdf4070a42ae20de
MD5 0fe57ebe9cb3427d1f086310570f02e5
BLAKE2b-256 691381ddcdcb75e472d152f9123284944135907a9fcd770cc54457c4380fba15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3fd08996a0f6749f6e8f5d145adbe853777247e1ffdff2ad872a68593724a7fe
MD5 883ffd51eeb64df5233e20cf6c389974
BLAKE2b-256 ced59ecd69e50405c2bfeb67f98f8066ddc82ae672b2a59da1ed0fdc0230073e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5e778bba17d73840bc35a1b7f73954e1ab9e8e7ccae4bffd323a4afd983f7545
MD5 d48a321fc26033ae5fc2dc860edd2689
BLAKE2b-256 6c1b9179a586ba2f7801accb125964ede1f04b4c59b4ae78a935fa2c4452a698

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dtw_python-1.4.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b0e807949085e3fc42770ce0883e33e2ba880d17f8431aef51d0847b9b440909
MD5 b7247ee775e5400ef27dd6df0fe52a57
BLAKE2b-256 89b68732a8eecc0268bf6be281e8af0819e780fe599991224ef61ec05403b559

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9edc99e777a4cd3a329aa22b10519d8685d4b027be7f61e4d320ecd87ca966cf
MD5 2b48b7a2a9e2b26fe82ea7e437cda894
BLAKE2b-256 31b44fa7686275e7e90893333b932bc06a6223831669ff6eb6544f3013996f79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dtw_python-1.4.4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c1df270b31e8b150ce5ec0e49b5aa766c371c215daab489adfefe76514c0c2b8
MD5 06a075ebc5b9f0c689cefcebd6f95792
BLAKE2b-256 cab2d74a51e1cb876fc85ce40a668d1771b072e0a65d4c75e7b6483974f6cd4f

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