python pandas parse date without delimiters 'time data '060116' does not match format '%dd%mm%YY' (match)'
<p>I am trying to parse a date column that looks like the one below,</p>

<pre><code>date
061116
061216
061316
061416
</code></pre>

<p>However I cannot get pandas to accept the date format as there is no delimiter (eg '/'). I have tried this below but receive the error: </p>

<blockquote>
  <p>ValueError: time data '060116' does not match format '%dd%mm%YY' (match)</p>
</blockquote>

<pre><code>pd.to_datetime(df['Date'], format='%dd%mm%YY')
</code></pre>

<p>You need add parameter <code>errors='coerce'</code> <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.to_datetime.html" rel="nofollow"><code>to_datetime</code></a>, because <code>13</code> and <code>14</code> months does not exist, so this dates are converted to <code>NaT</code>:</p>

<pre><code>print (pd.to_datetime(df['Date'], format='%d%m%y', errors='coerce'))
0   2016-11-06
1   2016-12-06
2          NaT
3          NaT
Name: Date, dtype: datetime64[ns]
</code></pre>

<p>Or maybe you need swap months with days:</p>

<pre><code>print (pd.to_datetime(df['Date'], format='%m%d%y'))

0   2016-06-11
1   2016-06-12
2   2016-06-13
3   2016-06-14
Name: Date, dtype: datetime64[ns]
</code></pre>

<p>EDIT:</p>

<pre><code>print (df)
         Date
0  0611160130
1  0612160130
2  0613160130
3  0614160130

print (pd.to_datetime(df['Date'], format='%m%d%y%H%M', errors='coerce'))
0   2016-06-11 01:30:00
1   2016-06-12 01:30:00
2   2016-06-13 01:30:00
3   2016-06-14 01:30:00
Name: Date, dtype: datetime64[ns]
</code></pre>

<p><a href="http://strftime.org/" rel="nofollow">Python's strftime directives</a>.</p>

python date datetime pandas time-series