title: How to plot parallel coordinates on pandas DataFrame with some columns containing strings?
body: <p>I would like to plot parallel coordinates for a <code>pandas</code> DataFrame containing columns with numbers and other columns containing strings as values.</p>
  
  <p><strong>Problem description</strong></p>
  
  <p>I have following test code which works for plotting parallel coordinates with numbers:</p>
  
  <pre><code>import pandas as pd
  import matplotlib.pyplot as plt
  from pandas.tools.plotting import parallel_coordinates
  
  df = pd.DataFrame([["line 1",20,30,100],\
      ["line 2",10,40,90],["line 3",10,35,120]],\
      columns=["element","var 1","var 2","var 3"])
  parallel_coordinates(df,"element")
  plt.show()
  </code></pre>
  
  <p>Which ends up showing following graphic:
  <a href="https://i.stack.imgur.com/XFfDK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XFfDK.png" alt="enter image description here"></a></p>
  
  <p>However what I would like to attempt is to add some variables to my plot that have strings. But when I run following code:</p>
  
  <pre><code>df2 = pd.DataFrame([["line 1",20,30,100,"N"],\
      ["line 2",10,40,90,"N"],["line 3",10,35,120,"N-1"]],\
      columns=["element","var 1","var 2","var 3","regime"])
  parallel_coordinates(df2,"element")
  plt.show()
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>ValueError: invalid literal for float(): N</p>
  </blockquote>
  
  <p>Which I suppose means <code>parallel_coordinates</code> function does not accept strings.</p>
  
  <p><strong>Example of what I am trying to do</strong></p>
  
  <p>I am attemting to do something like this example, where Race and Sex are strings and not numbers:</p>
  
  <p><a href="https://i.stack.imgur.com/NdK7z.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NdK7z.png" alt="Parallel coordinates plot with string values included"></a></p>
  
  <p><strong>Question</strong></p>
  
  <p>Is there any way to perform such a graphic using <code>pandas</code> <code>parallel_coordinates</code>? If not, how could I attempt such graphic? Maybe with <code>matplotlib</code>?</p>
  
  <p>I must mention I am particularily looking for a solution under <strong>Python 2.5</strong>  with pandas version <code>0.9.0</code>.</p>