title: df group by 2 columns and n.largest on 3rd column
body: <p>I have a problem, this is my df</p>
  <pre><code>{'libelle_competence': {0: 'Accessoires automobile',
    1: 'Accueil téléphonique',
    2: 'Activités de remise en forme',
    3: 'Activités physiques et sportives adaptées',
    4: 'Activités physiques pour tous'},
   'Familles professionnelles': {0: ' Vendeurs',
    1: ' Professions para-médicales',
    2: &quot; Professionnels de l'action culturelle, sportive et surveillants&quot;,
    3: &quot; Professionnels de l'action culturelle, sportive et surveillants&quot;,
    4: &quot; Professionnels de l'action culturelle, sportive et surveillants&quot;},
   'prevalence comp': {0: 0.264107210349354,
    1: 0.25039387926072904,
    2: 0.5523925685283885,
    3: 0.5523925685283885,
    4: 0.5523925685283885},
   'prevalence comp %': {0: 26.410721034935314,
    1: 25.03938792607282,
    2: 55.23925685283866,
    3: 55.23925685283866,
    4: 55.23925685283866}}
  </code></pre>
  <p>I want to group by Familles professionnelles and libelle_competence and to add to sort the prevalence % column with nlargest(10) (only to keep the 10 first libelle competence)</p>
  <pre><code>df.groupby([&quot;Familles professionnelles&quot;,&quot;libelle_competence&quot;])[&quot;prevalence comp %&quot;].nlargest(10)
  </code></pre>
  <p>but this is not what I want.</p>
  <p>Edit : What I show is basically a head of my dataframe to dict. Here is what my df looks like:
  <a href="https://i.stack.imgur.com/xB3jZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xB3jZ.png" alt="enter image description here" /></a></p>
  <p>the idea is to plot a graph for each 'famille professionnelles' when I keep only the top 10 libelle_competence that correspond to prevalence comp % . Is it better ?</p>