title: Merging time series data by timestamp using numpy/pandas
body: <p>I have time series data from three completely different sensor sources as CSV files and want to combine them into one big CSV file.
  I've managed to read them into numpy using numpy's genfromtxt, but I'm not sure what to do from here.</p>
  
  <p>Basically, what I have is something like this:</p>
  
  <p>Table 1:</p>
  
  <pre><code>timestamp    val_a   val_b   val_c
  </code></pre>
  
  <p>Table 2:</p>
  
  <pre><code>timestamp    val_d   val_e   val_f   val_g
  </code></pre>
  
  <p>Table 3:</p>
  
  <pre><code>timestamp    val_h   val_i
  </code></pre>
  
  <p>All timestamps are UNIX millisecond timestamps as numpy.uint64.</p>
  
  <p>And what I want is:</p>
  
  <pre><code>timestamp    val_a   val_b   val_c   val_d   val_e   val_f   val_g   val_h   val_i
  </code></pre>
  
  <p>...where all data is combined and ordered by timestamps. Each of the three tables is already ordered by timestamp.
  Since the data comes from different sources, there is no guarantee that a timestamp from table 1 will also be in table 2 or 3 and vice versa. In that case, the empty values should be marked as N/A.</p>
  
  <p>So far, I have tried using pandas to convert the data like so:</p>
  
  <pre><code>df_sensor1 = pd.DataFrame(numpy_arr_sens1)
  df_sensor2 = pd.DataFrame(numpy_arr_sens2)
  df_sensor3 = pd.DataFrame(numpy_arr_sens3)
  </code></pre>
  
  <p>and then tried using pandas.DataFrame.merge, but I'm pretty sure that won't work for what I'm trying to do now. Can anyone point me in the right direction?</p>