tslearn’s documentation

tslearn is a Python package that provides machine learning tools for the analysis of time series. This package builds on (and hence depends on) scikit-learn, numpy and scipy libraries.

If you plan to use the shapelets module from tslearn, keras and tensorflow should also be installed.



C++ build tools should be available to perform installation.

Using conda

The easiest way to install tslearn is probably via conda:

conda install -c conda-forge tslearn

Using PyPI

Using pip should also work fine:

pip install tslearn

Using latest github-hosted version

If you want to get tslearn’s latest version, you can refer to the repository hosted at github:

pip install git+https://github.com/rtavenar/tslearn.git


It seems on some platforms Cython dependency does not install properly. If you experiment such an issue, try installing it with the following command:

pip install cython

or (depending on your preferred python package manager):

conda install -c anaconda cython

before you start installing tslearn.