Getting facet grid plot out of Pandas dataframe
<p>So I have a dataframe that looks like: (1st col is just index)</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>CCS_Category_ICD9 Gender Admit_Month count
0 1 M 9 1
1 2 F 1 5
2 2 F 3 1
3 2 F 4 1
4 2 F 5 2
5 2 F 8 3
6 2 F 9 1
7 2 F 10 1
8 2 F 11 3
9 2 F 12 5
10 2 M 2 2
11 2 M 4 1
12 2 M 5 4
13 2 M 7 2
14 2 M 8 11
15 2 M 11 2
16 2 M 12 1
17 3 F 9 1
18 3 M 8 1
19 3 M 11 1
20 4 F 1 8
21 4 F 2 10
22 4 F 3 6
23 4 F 4 10
24 4 F 5 35
25 4 F 6 13
26 4 F 7 10
27 4 F 8 23
28 4 F 9 12
29 4 F 10 13
... ... ... ... ...
4758 2620 M 7 7</code></pre>
</div>
</div>
</p>

<p>I have been trying to get a plot by ccs code and the count of by admit_month and gender using seaborn</p>

<p>This sort of gets in the right direction:</p>

<pre><code>g = sns.factorplot(x="Admit_Month", y="count", column='CCS_Category_ICD9',data=ngrpdf)
</code></pre>

<p><a href="https://i.stack.imgur.com/xRTTE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xRTTE.png" alt="Admit by month"></a></p>

<p>But what I really want is a full set of charts one per ccs_category with the admit month as the bottom axis and bars indicating the counts by gender for the month</p>

<p>So I was trying something like:</p>

<pre><code>g = sns.FacetGrid(ngrpdf, col='CCS_Category_ICD9',hue='CCS_Category_ICD9', col_wrap=4)
g.map(sns.factorplot(x="Admit_Month", y="count"))
</code></pre>

<p>Which just blows up, and nothing seems to get me bars by gender..
Been messing around sadly for a while with no luck. any guidance appreciated...</p>