title: Time series data processing algorithm problem
body: <p>I have accelerometer data, X, Y, Z and Type (this is the label) which can be 'fast', 'slow', 'normal'. I should use the data for supervised learning, classification. I am a new to time series data and I found this function to process the data but I am not quite sure how it works. Can anyone help me get the concept of it? Or any other algorithms to process the data and then pass the features and label to a model?</p>
  <pre><code>def  get_frames(df, frame_size, hop_size):
  N_FEATURES=3
  
  frames=[]
  labels=[]
  for i in range(0, len(df)-frame_size, hop_size):
      x=df['X'].values[i: i+frame_size]
      y=df['Y'].values[i: i+frame_size]
      z=df['Z'].values[i: i+frame_size]
      label=stats.mode(df['Type'][i:i+frame_size])
      frames.append([x,y,z])
      labels.append(label)
      
  frames=np.asarray(frames).reshape(-1, frame_size, N_FEATURES)
  labels=np.asarray(labels)
      
  return frames, labels
  </code></pre>