need help pivoting pandas table
<pre><code>print df
             output_time   position
0    2016-01-01 08:00:01      start
1    2016-01-01 08:07:53        end
2    2016-01-01 08:07:54      start
3    2016-01-01 08:09:23        end
4    2016-01-01 08:09:24      start
5    2016-01-01 08:32:51        end
</code></pre>

<p>I need the output as such (with df remaining a dataframe type not series type:</p>

<pre><code>print df
              start                   end
2016-01-01 08:00:01   2016-01-01 08:07:53
2016-01-01 08:07:54   2016-01-01 08:09:23
2016-01-01 08:09:24   2016-01-01 08:32:51
</code></pre>

<p><code>df = df.pivot_table(columns="output_time", values="position")</code> gives the following error:</p>

<blockquote>
  <p>raise DataError('No numeric types to aggregate')
      pandas.core.base.DataError: No numeric types to aggregate</p>
</blockquote>

<p>This seems to be really quick though <code>pivot_table</code> was actually asked:</p>

<pre><code>data = df.T.unstack().ravel()
pd.DataFrame(data={data[1]:data[0::4], data[3]:data[2::4]})
</code></pre>

<p><a href="http://i.stack.imgur.com/yD8xc.png" rel="nofollow"><img src="http://i.stack.imgur.com/yD8xc.png" alt="Image"></a></p>

python pandas numpy