title: Merging csv files in directory based on Timestamps
body: <p>I'm currently learning Python for data manipulation. I've wrote a basic script to get two csv files and merge them based on Time Stamps and produce another csv file which is the result of those merged datasets.</p>
  
  <p>However, I struggling to create a way to merge multiple csv files that are located in a directory based on TimeStamps. This is what I have currently:</p>
  
  <pre><code>import pandas as pd
  from datetime import datetime
  
  dataset1 = pd.read_csv('ds1.csv', index_col=0, parse_dates=[0])
  dataset2 = pd.read_csv('ds2.csv', index_col=0, parse_dates=[0])
  
  combinecsv = pd.merge(dataset1,dataset2, on='DateTime',how = 'outer')
  combinecsv.to_csv(r"C:\Users\General\Documents\Data\combined.csv")
  
  validcsv = pd.merge(dataset1,dataset2, on='DateTime',how = 'inner')
  validcsv.to_csv(r"C:\Users\General\Documents\Data\valid.csv")
  </code></pre>
  
  <p>Any advice or directions on where to look at to be able to learn how to merge multiple (10+) csv files based on Time Stamps would be greatly appreciated.</p>
  
  <p>Thanks!</p>