title: Plot dates vs values in Python
body: <p>I have a very standard dataset with 2 columns, 1 for dates and 1 for values. I've put them into two arrays:</p>
  
  <pre><code>dates
  ['1/1/2014', '1/2/2014', '1/3/2014', ...]
  
  values
  [1423, 4321, 1234, ...]
  </code></pre>
  
  <p>How can I create a simple line graph with "values" on the y-axis and "dates" on the x-axis?</p>
  
  <p><strong>What I've tried:</strong></p>
  
  <p>I can do a "Hello world" line plot with only "values" in just 1 line (awesome):</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  plt.plot(values)
  </code></pre>
  
  <p>Next, let's add "dates" as the x-axis.  At this point I'm stuck. How can I transform my "dates" array, which is strings, into an array that is plottable?</p>
  
  <p>Looking at examples, I believe we are supposed to cast the strings into Python Date objects. Let's import those libraries:</p>
  
  <pre><code>import datetime
  import matplotlib.dates
  </code></pre>
  
  <p>Ok so now I can transform a string into a date <code>time.strptime(dates[1], '%m/%d/%Y')</code>. How can I transform the entire array? I could write a loop, but assuming there is a better way. </p>
  
  <p>I'm not 100% sure I'm even on the right path to making something usable for "Dates" vs "values". If you know the code to make this graph (I'm assuming it's very basic once you know Python + the libraries), please let me know.</p>