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>This does it:    </p>

<pre><code>import numpy as np

np.array([[a] for a in s],dtype=object)
array([[1],
       [2]], dtype=object)
</code></pre>

python pandas numpy