title: Converting a series of ints to strings - Why is apply much faster than astype?
body: <p>I have a <code>pandas.Series</code> containing integers, but I need to convert these to strings for some downstream tools. So suppose I had a <code>Series</code> object:</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  x = pd.Series(np.random.randint(0, 100, 1000000))
  </code></pre>
  
  <p>On StackOverflow and other websites, I've seen most people argue that the best way to do this is:</p>
  
  <pre><code>%% timeit
  x = x.astype(str)
  </code></pre>
  
  <p>This takes about 2 seconds. </p>
  
  <p>When I use <code>x = x.apply(str)</code>, it only takes 0.2 seconds.</p>
  
  <p>Why is <code>x.astype(str)</code> so slow? Should the recommended way be <code>x.apply(str)</code>? </p>
  
  <p>I'm mainly interested in python 3's behavior for this. </p>