Plotting box plots in python without grouping the data
<p>I want to plot a box plot for a variable in a data frame <code>xldata['yaxis_data']</code> according to 1,0 mapping stored in another array (<code>one_zero_map</code>).</p>

<p>I have a working code for this I am just not sure if this is the best way. Any help would be great. </p>

<p>Reason I am unsure is I am guessing there should be a direct way for boxplot to understand what I want if I input directly <code>one_zero_map</code> and <code>xldata['yaxis_data']</code> without creating good_ones and bad_ones and then putting them in a list called <code>final_list</code></p>

<pre><code>%matplotlib inline
import matplotlib.pyplot as plt

good_ones=[val for ind, val in zip(one_zero_map,xldata['yaxis_data']) if  ind==1]
bad_ones=[val for ind, val in zip(one_zero_map,xldata['yaxis_data']) if ind==0]

final_list=[good_ones,bad_ones]

plt.boxplot(final_list)
</code></pre>

<p>Just to be more clear on what I am looking for, I am looking for Python equivalent of <a href="http://www.statmethods.net/graphs/boxplot.html" rel="nofollow">R</a> which is like this</p>

<pre><code># Boxplot of MPG by Car Cylinders 
boxplot(mpg~cyl,data=mtcars, main="Car Milage Data", 
xlab="Number of Cylinders", ylab="Miles Per Gallon")
</code></pre>

<p>or phython equivalent of graphlab as</p>

<pre><code>sales.show(view='BoxWhisker Plot',x='zipcode',y='price')
</code></pre>