Turn pandas series to series of lists or numpy array to array of lists
<p>I have a series <code>s</code></p>

<pre><code>s = pd.Series([1, 2])
</code></pre>

<p>What is an efficient way to make <code>s</code> look like</p>

<pre><code>0    [1]
1    [2]
dtype: object
</code></pre>

<p>Adjusting atomh33ls' answer, here's a series of lists:</p>

<pre><code>output = pd.Series([[a] for a in s])
type(output)
&gt;&gt; pandas.core.series.Series
type(output[0])
&gt;&gt; list
</code></pre>

<p>Timings for a selection of the suggestions:</p>

<pre><code>import numpy as np, pandas as pd
s = pd.Series(np.random.randint(1,10,1000))

&gt;&gt; %timeit pd.Series(np.vstack(s.values).tolist())
100 loops, best of 3: 3.2 ms per loop

&gt;&gt; %timeit pd.Series([[a] for a in s])
1000 loops, best of 3: 393 Âµs per loop

&gt;&gt; %timeit s.apply(lambda x: [x])
1000 loops, best of 3: 473 Âµs per loop
</code></pre>

python pandas numpy