title: How to resample multiple files of time series data to be all the same length (same # of observations)
body: <p>I have many csv files which are of time series data (i.e. the data are sequential, however no time column exists).</p>
  
  <p>I need to make all the files the same length in order to feed them into tensorflow. I could make them all the size of the file with largest length, or just use the average length of all files. -doesn't really matter-</p>
  
  <p>Since the files don't have time column, I converted the index colummn to timedate with unit 's' and used this column in the resampling.</p>
  
  <p>To give you a sample of the shape of my data, when running <code>df.head(3)</code> ,this is the result:</p>
  
  <pre><code>       0        1        2        3        4        5        6        7  
  0  0.30467  0.45957 -0.95414  1.74687  1.42338 -0.03860  2.20401  1.44406   
  1  0.27331  0.59293 -1.00874  1.74135  1.32004 -0.00701  2.20917  1.34164   
  2  0.30348  0.88129 -1.05517  1.75090  1.65138 -0.03112  2.21598  1.68487   
  
  </code></pre>
  
  <p>This is what I have tried so far to no avail:</p>
  
  <pre class="lang-py prettyprint-override"><code>for file in files:
       df=pd.read_csv(file, header=None)
       resampled=df.set_index(pd.to_datetime(df.index,unit='s')).resample('250ms')
  
  resamp=pd.DataFrame(resampled)
  </code></pre>
  
  <p>I aslo tried: <code>df.set_index(pd.to_datetime(df.index,unit='s')).resample('250ms').asfreq()</code> and <code>df.set_index(pd.to_datetime(df.index,unit='s')).resample('250ms').asfreq().interpolate()</code></p>
  
  <p>None of the above gave dataframes of the same length. They all returned dfs of different lengths.</p>
  
  <p>I expect the output to be resampled data such that all the files are of the same length (i.e. same number of observations) and are correctly resampled (either upsampled or downsampled).</p>
  
  <p>After having resampled the files, I need to concatenate all of them to have one big file which I can then reshape to input to tensorflow.</p>
  
  <p>I am new to Python so I will really appreciate support here.</p>