Put a 2d Array into a Pandas Series : <p>I have a 2D Numpy array that I would like to put in a pandas Series (not a DataFrame):</p>

<pre><code>&gt;&gt;&gt; import pandas as pd
&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; a = np.zeros((5, 2))
&gt;&gt;&gt; a
array([[ 0.,  0.],
       [ 0.,  0.],
       [ 0.,  0.],
       [ 0.,  0.],
       [ 0.,  0.]])
</code></pre>

<p>But this throws an error:</p>

<pre><code>&gt;&gt;&gt; s = pd.Series(a)
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/miniconda/envs/pyspark/lib/python3.4/site-packages/pandas/core/series.py", line 227, in __init__
    raise_cast_failure=True)
  File "/miniconda/envs/pyspark/lib/python3.4/site-packages/pandas/core/series.py", line 2920, in _sanitize_array
    raise Exception('Data must be 1-dimensional')
Exception: Data must be 1-dimensional
</code></pre>

<p>It is possible with a hack:</p>

<pre><code>&gt;&gt;&gt; s = pd.Series(map(lambda x:[x], a)).apply(lambda x:x[0])
&gt;&gt;&gt; s
0    [0.0, 0.0]
1    [0.0, 0.0]
2    [0.0, 0.0]
3    [0.0, 0.0]
4    [0.0, 0.0]
</code></pre>

<p>Is there a better way?</p>
