title: Operations on Pandas DataFrame Index
body: <p>How can I easily perform an operation on a Pandas DataFrame Index?  Lets say I create a DataFrame like so:</p>
  
  <pre><code>df = DataFrame(rand(5,3), index=[0, 1, 2, 4, 5])
  </code></pre>
  
  <p>and I want to find the mean sampling rate.  The way I do this now doesn't seem quite right.</p>
  
  <pre><code>fs = 1./np.mean(np.diff(df.index.values.astype(np.float)))
  </code></pre>
  
  <p>I feel like there must be a better way to do this, but I can't figure it out.  </p>
  
  <p>Thanks for any help.</p>