title: Pandas pivoting/stacking/reshaping
body: <p>I'm trying to import data to a pandas DataFrame with columns being date string, label, value. My data looks like the following (just with 4 dates and 5 labels)</p>
  
  <pre><code>from numpy import random
  import numpy as np
  import pandas as pd
  
  # Creating the data
  dates = ("2015-01-01", "2015-01-02", "2015-01-03", "2015-01-04")
  values = [random.rand(5) for _ in range(4)]
  
  data = dict(zip(dates,values))
  </code></pre>
  
  <p>So, the data is a dictionary where the keys are dates, the keys a list of values where the index is the label.</p>
  
  <p>Loading this data structure into a DataFrame</p>
  
  <pre><code>df1 = pd.DataFrame(data)
  </code></pre>
  
  <p>gives me the dates as columns, the label as index, and the value as the value.</p>
  
  <p>An alternative loading would be </p>
  
  <pre><code>df2 = pd.DataFrame()
  df2.from_dict(data, orient='index')
  </code></pre>
  
  <p>where the dates are index, and columns are labels.</p>
  
  <p>In either of both cases do I manage to do pivoting or stacking to my preferred view.</p>
  
  <p>How should I approach the pivoting/stacking to get the view I want? Or should I change my data structure before loading it into a DataFrame? In particular I'd like to avoid of having to create all the rows of the table beforehand by using a bunch of calls to <code>zip</code>.</p>