title: How to add a date from filename to a time column to make datetime column? Python Pandas
body: <p>I have multiple files that are named like this<br>
  <code>2018-08-31-logfile-device1 
  2018-09-01-logfile-device1</code></p>
  
  <p>in these files the data is sorted this way:<br>
  <code>00:00:00.283672analogue values:[2511, 2383, 2461, 2472]
  00:00:00.546165analogue values:[2501, 2395, 2467, 2465]</code></p>
  
  <p>I append all these files into one big dataframe with this code: (i got from here: <a href="https://stackoverflow.com/questions/20908018/import-multiple-excel-files-into-python-pandas-and-concatenate-them-into-one-dat">Import multiple excel files into python pandas and concatenate them into one dataframe</a>)</p>
  
  <pre><code>file_log = os.listdir(path)
  file_log = [file_log for file_log in glob.glob('*device1*')]
  df = pd.DataFrame()
  for file_log in file_log:
      data = pd.read_csv(file_log,sep='analogue values:',names=['time', 
  'col'], engine='python')
      df = data.append(data1)
  </code></pre>
  
  <p>I transform the data and then it looks like this:<br>
  <code>analog1 analog2 analog3 analog4      time
  2511    2383    2461    2472  00:00:00.283672
  2501    2395    2467    2465  00:00:00.546165
  2501    2395    2467    2465  00:00:00.807846
  2497    2381    2461    2467  00:00:01.070540
  2485    2391    2458    2475  00:00:01.332163</code></p>
  
  <p>but the problem is, I want the time column to be date time, where the date is the date from the filename it came from. </p>
  
  <p><code>analog1 analog2 analog3 analog4      datetime
  2511    2383    2461    2472       2018-08-31 00:00:00.283672
  2501    2395    2467    2465       2018-08-31 00:00:00.546165
  2501    2395    2467    2465       2018-08-31 00:00:00.807846
  2497    2381    2461    2467       2018-08-31 00:00:01.070540
  2485    2391    2458    2475       2018-08-31 00:00:01.332163</code></p>