How to use a pandas DataFrame as data parameter in Seaborn lmplot
<p>Looking at the <a href="https://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.lmplot.html" rel="nofollow"><code>lmplot</code> documentation</a>, it shows</p>

<blockquote>
  <p>Parameters:    </p>

<pre><code>      x, y : strings, optional

            Input variables; these should be column names in data.

      data : DataFrame

              Tidy (âlong-formâ) dataframe where each column 
              is a variable and each row is an observation.
</code></pre>
</blockquote>

<p>I have a pandas dataframe <code>customers</code> that I would like to use as a parameter for a <code>lmplot</code>. How can I transform my pandas dataframe into a tidy ("long-form") dataframe for use in <code>lmplot</code>?</p>

<p>Currently, I'm trying to do the following:</p>

<pre><code>sns.lmplot(customers["Length of Membership"], customers["Yearly Amount Spent"], customers)
</code></pre>

<p>(Seaborn is imported as <code>sns</code>). The python code above returns an error that contains a very long list of floating points.</p>

<p>Thanks to <a href="http://stackoverflow.com/users/3437504/bob-haffner">Bob Haffner</a>, looking closer at the documentation, the DataFrame wasn't the issue at all, rather, the X and Y parameters I was passing. </p>

<p>I was passing in Series, when I should have been passing in strings, as such:</p>

<pre><code>sns.lmplot("Length of Membership", "Yearly Amount Spent", customers)
</code></pre>

python pandas dataframe seaborn