title: Pandas: Load CSV as 2D Matrix
body: <p>I'm just starting out with scipy/pandas so that might be absolutely easy but I am lost here.</p>
  
  <p>I have a CSV file with 3 columns: User Artist Rating</p>
  
  <p>Now I want to have a 2D matrix with the rows being users, the columns being artists and the ratings as content.</p>
  
  <p>I tried <code>pandas.read_csv(file, index_col = [0,1])</code>, but then I get </p>
  
  <pre><code>               rating
  user  artist         
  amy   swift       4.0
        psy         3.0
        houston     4.0
  ben   swift       5.0
        psy         2.0
  clara psy         3.5
        houston     4.0
  daisy swift       5.0
        houston     3.0
  </code></pre>
  
  <p>But now I cannot index rows and cols like data[:,:].
  If I do <code>data.unstack()</code> the output is a 2D matrix with NaNs where there is no data, just as I want it! 
  BUT, I still cannot index because <code>data.index</code> is <code>Index([u'amy', u'ben', u'clara', u'daisy'], dtype='object')</code> so I can only index in one direction again.</p>
  
  <p>How can I achieve this 2D matrix? </p>
  
  <p>Thank you.</p>
  
  <p>EDIT1: </p>
  
  <p>If I unstack once the result is:</p>
  
  <pre><code>&gt;&gt;&gt; data2.ix[:,:]
           rating            
  artist  houston  psy  swift
  user                       
  amy           4  3.0      4
  ben         NaN  2.0      5
  clara         4  3.5    NaN
  daisy         3  NaN      5
  </code></pre>
  
  <p>Then I want to index the Psy column like: <code>data2.ix[:,'psy']</code>
  But I get <code>KeyError: 'psy'</code>
  <code>data2.ix[:,:]</code> works though. </p>
  
  <pre><code>&gt;&gt;&gt; data2.ix[:,['psy']]
  Empty DataFrame
  Columns: []
  Index: [amy, ben, clara, daisy]
  </code></pre>
  
  <p>Edit2:
  Expected output</p>
  
  <pre><code>&gt;&gt;&gt; data2.ix[:,1]
  user
  amy      3.0
  ben      2.0
  clara    3.5
  daisy    NaN
  Name: (rating, psy), dtype: float64
  </code></pre>
  
  <p>But I want to use 'psy' instead of 1.</p>
  
  <p>Edit3: csv</p>
  
  <pre><code>amy swift   4
  amy psy 3
  amy houston 4
  ben swift   5
  ben psy 2
  clara   psy 3.5
  clara   houston 4
  daisy   swift   5
  daisy   houston 3
  </code></pre>