title: Using datetime values as a pandas index and then obtaining that date value for a row
body: <p>I'm learning to use pandas and I'm parsing NOAA daily observations: (truncated here for clarity)</p>
  
  <pre><code>import pandas as pd
  import StringIO
  
  csv_data = """
  date,maxt,mint,avgt,pcpn,snow,snwd,hdd,cdd
  1872-01-01,48,28,38.0,0.00,M,M,27,0
  1872-01-02,43,28,35.5,0.00,M,M,29,0
  1872-01-03,47,25,36.0,0.00,M,M,29,0
  1872-01-04,39,22,30.5,0.00,M,M,34,0
  1872-01-05,37,15,26.0,0.03,M,M,39,0
  """
  fake_csv_file = StringIO.StringIO(csv_data)
  
  df = pd.read_csv(fake_csv_file, parse_dates=['date'], index_col='date')
  </code></pre>
  
  <p>When I check <code>df.index</code>, it appears that my index is comprised of <code>datetime</code> values:</p>
  
  <pre><code>&gt;&gt;&gt; df.index
  DatetimeIndex(['1872-01-01', '1872-01-02', '1872-01-03', '1872-01-04',
                 '1872-01-05'],
                dtype='datetime64[ns]', name=u'date', freq=None)
  </code></pre>
  
  <p>Now that my <code>date</code> value is the index instead of a column, I can't figure out how to access the <code>date</code> value. I can select a row:</p>
  
  <pre><code>&gt;&gt;&gt; first_row = df.loc['1872-01-01']
  &gt;&gt;&gt; print first_row
  maxt    48
  mint    28
  avgt    38
  pcpn     0
  snow     M
  snwd     M
  hdd     27
  cdd      0
  Name: 1872-01-01 00:00:00, dtype: object
  </code></pre>
  
  <p>Now I'd like to programmatically get that date value, but <code>first_row.index</code> returns something I didn't expect:</p>
  
  <pre><code>&gt;&gt;&gt; first_row.index
  Index([u'maxt', u'mint', u'avgt', u'pcpn', u'snow', u'snwd', u'hdd', u'cdd'], dtype='object')
  </code></pre>
  
  <p>I expected that <code>first_row.index</code> would return the <code>datetime</code> value, but instead it returns this list of all the columns. </p>
  
  <p>Did I do something wrong? What am I missing?</p>
  
  <p>In case my question isn't clear, I'd like to be able to get to the date value for a row the way I can for any of the columns:</p>
  
  <pre><code>&gt;&gt;&gt; df.maxt
  48
  &gt;&gt;&gt; df.mint
  28
  </code></pre>
  
  <p>Obviously, this returns a key error:</p>
  
  <pre><code>&gt;&gt;&gt; df.date # &lt;- something like this?
  </code></pre>
  
  <p>Also, in case anyone asks, I might want to get to the date value so I can use some of the <code>dt</code> goodies like <code>dayofyear</code> or <code>dayofweek</code>.</p>