wannesm / dtaidistance

Time series distances: Dynamic Time Warping (fast DTW implementation in C)
Other
1.08k stars 184 forks source link

Passing in time series rows, with two dimensions in each series, to dtw_ndim #135

Closed j7zAhU closed 2 years ago

j7zAhU commented 2 years ago

My goal is to cluster stocks.

I have a dataframe with columns: ["stock", "time", "price", "volume"]).

For 1-d analysis, with price alone, I use pd.pivot() to make time run horizontally and stocks vertically. With price as the value. I then take the numpy array.

How do I prepare the data when my time series now has ["price", "volume"] as the value?

Thank you!

wannesm commented 2 years ago

This is a question related to the Pandas package.