title: How to compute "doubling time" of discrete time series using Pandas or Numpy?
body: <p>Here's a data set. Each row is a time slice. The first column is a reading. The second one is how many time slices ago the reading was 50% of what it is. I calculated it by hand by eyeballing it so the numbers aren't exactly correct.</p>
  
  <pre><code>197 
  218 
  256 
  328     4
  413     4
  525     4
  646     4
  777     5
  1159    4
  1838    2
  2417    2
  3240    2.5
  4257    3
  4955    4
  5752    5.5
  6620    5
  7738    5.5
  8966    4.5
  10402   5
  </code></pre>
  
  <p>So, assume I have a DataFrame as follows:</p>
  
  <pre><code>df = pd.DataFrame({'val': [197,218,256,328,413,525,646,777,1159,1838,2417,3240,4257,4955,5752,6620,7738,8966,10402]})
  </code></pre>
  
  <p>How would I compute df.doubling? I can sort of imagine starting at the end and working backwards, each time scanning for a value 50% of my starting value. But there's a better way. I think it has to do with Log2 but not sure how to do it!</p>