Time formats match but still getting error. ValueError: time data 'Time' does match format specified pd.to_datetime
<p>my data column looks like this:</p>

<pre><code>0 Time

1 2014-07-28 00:17:35

2 2014-07-28 00:18:05

3 2014-07-28 01:50:54

4 2014-07-28 01:51:24

5 2014-07-28 01:53:57

6 2014-07-28 01:54:56
</code></pre>

<p>my code looks like this:</p>

<pre><code>df['Epoch'] = pd.to_datetime(df['Time'], format = "%Y-%m-%d %H:%M:%S")
</code></pre>

<p>and my error looks like this:</p>

<blockquote>
  <p>ValueError: time data 'Time' does match format specified</p>
</blockquote>

<p>really not sure if I'm missing something here. Please help.</p>

<p>Your dataframe is wrongly loaded: your header is interpreted as a row and is the first row of your dataframe. <code>pd.to_datetime</code> tries to transform the string 'Time' found row 0.</p>

<p>Load correctly your dataframe by getting the row 0 loaded as a header instead.</p>

<p>Something like this can move the firs row as colum titles and delete it as a row:</p>

<pre><code>df.columns = df.ix[0]
df = df.drop(0)
</code></pre>

python pandas time python-datetime