title: Pandas using loc for assignment in a Multi Index DataFrame
body: <p>I have initialised a dataframe like this:</p>
  
  <pre><code>df = pd.DataFrame(columns=["stockname","timestamp","price","volume"])
  df.timestamp = pd.to_datetime(df.timestamp, format = "%Y-%m-%d %H:%M:%S:%f")
  df.set_index(['stockname', 'timestamp'], inplace = True)
  </code></pre>
  
  <p>Now I get stream of data from somewhere but for the sake of program let me write it like this:</p>
  
  <pre><code>filehandle = open("datasource")
  
  for line in filehandle:
      line = line.rstrip()
      data = line.split(",")
      stockname = data[4]
      price = float(data[3])
      timestamp = pd.to_datetime(data[0], format = "%Y-%m-%d %H:%M:%S:%f")
      volume = int(data[6])
  
      df.loc[stockname, timestamp] = [price, volume]
  
  filehandle.close()
  
  print df
  </code></pre>
  
  <p>but this is giving error:</p>
  
  <blockquote>
    <p>ValueError: cannot set using a multi-index selection indexer with a different length than the value</p>
  </blockquote>