title: Convert to datetime in pandas
body: <p>I have data into a CSV file as follows:</p>
  <pre><code>Date,Bid,Ask
  04/12/19 11:00 AM,1970,2010
  05/12/19 11:00 AM,1960,2000
  05/12/19 04:00 PM,1900,1925
  06/12/19 11:00 AM,1890,1910
  06/12/19 04:00 PM,2000,2025
  </code></pre>
  <p>I am trying to convert the Date column to datetime using <strong>pd.to_datetime()</strong> but I am getting this error:</p>
  <p><strong>ValueError: time data '04/12/19 11:00 AM' does not match format '%d/%m/%y %I:%M %p' (match)</strong></p>
  <p>Here is my code:</p>
  <pre><code>import pandas as pd
  import matplotlib.pyplot as plt
  
  df = pd.read_csv(&quot;file_1.csv&quot;)
  df['Date'] = pd.to_datetime(df['Date'], format='%d/%m/%y %I:%M %p')
  df = df.set_index([&quot;Date&quot;])
  df.plot()
  plt.show()
  </code></pre>
  <p>And here is the whole error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/home/zakaria/.local/lib/python3.8/site-packages/pandas/core/tools/datetimes.py&quot;, line 450, in _convert_listlike_datetimes
      values, tz = conversion.datetime_to_datetime64(arg)
    File &quot;pandas/_libs/tslibs/conversion.pyx&quot;, line 350, in pandas._libs.tslibs.conversion.datetime_to_datetime64
  TypeError: Unrecognized value type: &lt;class 'str'&gt;
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;file.py&quot;, line 6, in &lt;module&gt;
      df['Date'] = pd.to_datetime(df['Date'], format='%d/%m/%y %I:%M %p')
    File &quot;/home/zakaria/.local/lib/python3.8/site-packages/pandas/core/tools/datetimes.py&quot;, line 803, in to_datetime
      values = convert_listlike(arg._values, format)
    File &quot;/home/zakaria/.local/lib/python3.8/site-packages/pandas/core/tools/datetimes.py&quot;, line 454, in _convert_listlike_datetimes
      raise e
    File &quot;/home/zakaria/.local/lib/python3.8/site-packages/pandas/core/tools/datetimes.py&quot;, line 417, in _convert_listlike_datetimes
      result, timezones = array_strptime(
    File &quot;pandas/_libs/tslibs/strptime.pyx&quot;, line 144, in pandas._libs.tslibs.strptime.array_strptime
  ValueError: time data '04/12/19 11:00 AM' does not match format '%d/%m/%y %I:%M %p' (match)
  </code></pre>