title: Can we cluster Multivariate Time Series dataset in Python
body: <p>I have a dataset with many financial signal values for different stocks at different times.For example</p>
  
  <pre><code>StockName  Date   Signal1  Signal2
  ----------------------------------
  Stock1     1/1/20    a       b
  Stock1     1/2/20    c       d
  .
  .
  .
  Stock2     1/1/20    e       f
  Stock2     1/2/20    g       h
  .
  .
  .
  </code></pre>
  
  <p>I would like to build a time series table look like below and cluster stocks based on both signal1 and signal2 (2 variables)</p>
  
  <pre><code>StockName   1/1/20    1/2/20    ........    Cluster#
  ----------------------------------------------------
   Stock1     [a,b]      [c,d]                    0
   Stock2     [e,f]      [g,h]                    1
   Stock3     ......     .....                    0
   .
   .
   .
  </code></pre>
  
  <p>1)Are there any ways to do this? (Clustering stocks based on multiple variables for the time series data). I tried to search online but they are all about clustering time series based on one variable.</p>
  
  <p>2)Also, are there any ways to cluster different stocks at different times as well? (So maybe Stock1 at time1 is in the same cluster with Stock2 at time3)</p>