title: Pandas DataFrame efficiently split one column into multiple
body: <p>I have a dataframe similar to this:</p>
  <pre><code>data = {&quot;col_1&quot;: [0, 1, 2],
          &quot;col_2&quot;: [&quot;abc&quot;, &quot;defg&quot;, &quot;hi&quot;]}
  df = pd.DataFrame(data)
  </code></pre>
  <p>Visually:</p>
  <pre><code>   col_1 col_2
  0      0   abc
  1      1   defg
  2      2   hi
  </code></pre>
  <p>What I'd like to do is <strong>split up each character in col_2, and append it as a new column</strong> to the dataframe</p>
  <p>example iterative method:</p>
  <pre><code>def get_chars(string):
      chars = []
      for char in string:
          chars.append(char)
      return chars
  
  char_df = pd.DataFrame()
  for i in range(len(df)):
      char_arr = get_chars(df.loc[i, &quot;col_2&quot;])
      temp_df = pd.DataFrame(char_arr).T
      char_df = pd.concat([char_df, temp_df], ignore_index=True, axis=0)
  
  df = pd.concat([df, char_df], ignore_index=True, axis=1)
  </code></pre>
  <p>Which results in the correct form:</p>
  <pre><code>   0     1  2  3    4    5
  0  0   abc  a  b    c  NaN
  1  1  defg  d  e    f    g
  2  2    hi  h  i  NaN  NaN
  </code></pre>
  <p>But I believe iterating though the dataframe like this is very inefficient, so <strong>I want to find a faster (ideally vectorised) solution.</strong></p>
  <p>In reality, I'm not really splitting up strings, but the point of this question is to find a way to efficiently process one column, and return many.</p>