slaypni / fastdtw

A Python implementation of FastDTW
MIT License
774 stars 122 forks source link

Synchronize more than 2 Time-Series #50

Closed pit9921 closed 3 years ago

pit9921 commented 3 years ago

Hi,

with the following code there is possible to synchronize two time series (x and y).

import numpy as np from scipy.spatial.distance import euclidean

from fastdtw import fastdtw

x = np.array([[1,1], [2,2], [3,3], [4,4], [5,5]])
y = np.array([[2,2], [3,3], [4,4]])
distance, path = fastdtw(x, y, dist=euclidean)

Is there any way how to synchronize more than two time series?

I tried to: distance, path = fastdtw(x, y, z, dist=euclidean) but only size-1 arrays can be converted to Python scalars.

pit9921 commented 3 years ago

Is there any possibility how to iretate over all columns in df? I have asked already here: https://stackoverflow.com/questions/67447727/iretate-over-columns-in-df-and-calculate-euclidean-distance-with-one-column-in-pandas?

pit9921 commented 3 years ago

Solution found.