title: Why is pandas' indexing so slow? How to make it faster?
body: <p>Running this code shows the difference in speed between pandas and a regular python list:</p>
  
  <pre><code>ser = pd.Series(range(100))
  lst = ser.tolist()
  
  for _ in range(10):
      pandas_time = 0
      list_time = 0
      for _ in range(100000):
          r = randint(0, len(ser)-1)
          t = time()
          ser[r]
          pandas_time += time() - t
  
          t = time()
          lst[r]
          list_time += time() - t
  
      print(pandas_time, list_time)
  </code></pre>
  
  <p>The results (10 trials of indexing random elements 100000 times):</p>
  
  <pre><code>Pandas             Regular List
  0.6404812335968018 0.03125190734863281
  0.6560468673706055 0.0
  0.5779874324798584 0.01562190055847168
  0.5467743873596191 0.015621662139892578
  0.6106545925140381 0.004016399383544922
  0.5866603851318359 0.029597759246826172
  0.7981059551239014 0.016004562377929688
  0.8128316402435303 0.013040542602539062
  0.5566465854644775 0.021578073501586914
  0.6386256217956543 0.00500178337097168
  </code></pre>
  
  <p>Indexing a pandas series seems to be 30 - 100 times slower than a python list. Why? How can we speed this up?</p>