get index value from merged pandas time series?
<p>I have various time series pandas data frames which look like:</p>

<p>data['F_NQ'] = </p>

<p><code>OPEN   HIGH    LOW  CLOSE     VOL      OI  P  R  RINFO
DATE<br>
1996-04-10  12450  12494  12200  12275    2282     627  0  0      0
1996-04-11  12200  12360  12000  12195    1627     920  0  0      0</code></p>

<p>I merged these into one dataframe so that I could select by date using concat
<code>mergeData = pd.concat(data, axis=1, keys=data.keys())</code></p>

<p>Now I can get a slice for a chunk of time:
<code>timeSlice = mergeData.loc[startDate:endDate]</code></p>

<p>my problem is that I am looping over that timeSlice object and selecting a particular day based on the index number...</p>

<p><code>selectedDay = timeSlice.iloc[n]</code></p>

<p>I need to know the DATE for the selected row.  How do I access that location value?  If I provide the location value with: <code>selectedDay = timeSlice.loc[date]</code> the correct information is returned.  At the time I'm making the call however I don't know the date.  How do I get at that information?</p>

<p>This helped me find the solution... <a href="http://stackoverflow.com/questions/18327624/find-elements-index-in-pandas-series">post</a></p>

<p>I basically need to call: <code>timeSlice.index[-1]</code> to get the last date from whichever time block I've selected.</p>

python pandas time-series