title: Pandas running division for a column
body: <p>I'm new to Pandas and would love some help   I'm trying to take:</p>
  
  <pre><code>factor
  1
  1
  2
  1
  1
  3
  1
  2
  </code></pre>
  
  <p>and produce:</p>
  
  <pre><code>factor  running_div
  1            1
  1            1 
  2            0.5
  1            0.5
  1            0.5
  3            0.1666667
  1            0.1666667
  2            0.0833333
  </code></pre>
  
  <p>I can do it by looping through using .iloc, but trying to use vector math for efficiency.   Have looked at rolling window and using .shift(1), but can't get it working.   Would appreciate any guideance anyone could provide.</p>