How to join two pandas Series into a single one with interleaved values?
<p>I have two pandas.Series...</p>

<pre><code>import pandas as pd
import numpy as np

length = 5
s1 = pd.Series( [1]*length ) # [1, 1, 1, 1, 1]
s2 = pd.Series( [2]*length ) # [2, 2, 2, 2, 2]
</code></pre>

<p>...and I would like to have them joined together in a single Series with the interleaved values from the first 2 series.
Something like: [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]</p>

<p>Here's one using <code>NumPy stacking</code>, <a href="http://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.vstack.html" rel="nofollow"><code>np.vstack</code></a> -</p>

<pre><code>pd.Series(np.vstack((s1,s2)).ravel('F'))
</code></pre>

python pandas numpy