title: How to load data from np matrix to seaborn?
body: <p>I want to build own <code>Scatterplot Matrix</code> with <code>labels</code> and <code>colors</code>. I like this example: <a href="http://stanford.edu/~mwaskom/software/seaborn/examples/scatterplot_matrix.html" rel="nofollow">Scatterplot Matrix</a>.</p>
  
  <p>I have one problem. I don't understand, how exactly to load data from <code>numpy matrix</code> to <code>seaborn dataframe</code>. </p>
  
  <pre><code>data_resc = np.random.rand(150,2)
  
  sns.set()
  
  df = DataFrame(data_resc)
  sns.pairplot(df, hue="species", size=2.5)
  sns.plt.show()
  </code></pre>
  
  <p>This code snippet has errors:</p>
  
  <pre><code>Traceback (most recent call last):
    File "pandas\index.pyx", line 154, in pandas.index.IndexEngine.get_loc (pandas\index.c:3687)
    File "pandas\hashtable.pyx", line 381, in pandas.hashtable.Int64HashTable.get_item (pandas\hashtable.c:7192)
  TypeError: an integer is required
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "file.py", line 69, in &lt;module&gt;
      main()
    File "file.py", line 64, in main
      sns.pairplot(df, hue="species", size=2.5)
    File "C:\Python34\lib\site-packages\seaborn\linearmodels.py", line 1720, in pairplot
      size=size, aspect=aspect, dropna=dropna, **grid_kws)
    File "C:\Python34\lib\site-packages\seaborn\axisgrid.py", line 857, in __init__
      hue_names = np.unique(np.sort(data[hue]))
    File "C:\Python34\lib\site-packages\pandas\core\frame.py", line 1780, in __getitem__
      return self._getitem_column(key)
    File "C:\Python34\lib\site-packages\pandas\core\frame.py", line 1787, in _getitem_column
      return self._get_item_cache(key)
    File "C:\Python34\lib\site-packages\pandas\core\generic.py", line 1068, in _get_item_cache
      values = self._data.get(item)
    File "C:\Python34\lib\site-packages\pandas\core\internals.py", line 2849, in get
      loc = self.items.get_loc(item)
    File "C:\Python34\lib\site-packages\pandas\core\index.py", line 1402, in get_loc
      return self._engine.get_loc(_values_from_object(key))
    File "pandas\index.pyx", line 134, in pandas.index.IndexEngine.get_loc (pandas\index.c:3807)
    File "pandas\index.pyx", line 156, in pandas.index.IndexEngine.get_loc (pandas\index.c:3744)
  KeyError: 'species'
  </code></pre>