title: Pivot Table Pandas
body: <p>My problem is edit the subtotals of each category and display the total and then edit the column "All" but I can't do it .
  Please, tell me how to proceed please.
  Link file for prets_preview : <a href="http://www.cjoint.com/c/GBijO4uZYjt" rel="nofollow noreferrer">http://www.cjoint.com/c/GBijO4uZYjt</a>
  and issues_out : <a href="http://www.cjoint.com/c/GBsm0IXIILE" rel="nofollow noreferrer">http://www.cjoint.com/c/GBsm0IXIILE</a>
  Thanks you for your help.</p>
  
  <pre><code>In [1]: import pandas as pd
  
  In [2]: import numpy as np
  
  In [3]: from pandas import DataFrame
  
  In [4]: issues=pd.read_table('prets_preview.csv')
  
  In [5]: site={'BUS1A' : 'Zèbre', 'MED0A' : 'Collectivités'}
  
  In [6]: issues ['localisation'] = issues['localisation'].map(site)
  
  In [7]: issues ['localisation'] = issues['localisation'].fillna('Médiathèque')
  
  In [8]: resultat = issues ['id_exemplaire'].groupby([issues['localisation'],issues.ccode, issues['support']]).count()
  
  In [9]: table = pd.pivot_table(issues,values=['id_exemplaire'], index=['locali sation'], columns =['support'], aggfunc =np.sum,margins = True)
  
  In [10]: resultat = table.stack('support')
  
  In [11]: resultat.to_csv('issues_out.csv')
  
  In [12]: resultat = issues['id_exemplaire'].groupby(issues['localisation'])
      .count()
  
  In [13]: resultat = issues['id_exemplaire'].groupby([issues['localisation'], is ues['support'], issues['ccode']]).count()
  
  
  In [16]: table = pd.pivot_table ( issues, values=['id_exemplaire'], index=['localisation'], columns=['support'], aggfunc= np.sum, margins = True)
  </code></pre>
  
  <p>I need to display the subtotals more clearly and edit the column "All" but i don't know how to do.</p>
  
  <pre><code>                                        **id_exemplaire
  localisation  support
  Collectivités All                            300390.0
                DVD                                 0.0
                Disque compact                      0.0
                Disque microsillon                  0.0
                Livre                          300390.0
                Livre en gros caractères            0.0
                Livre sonore                        0.0
                Périodique                          0.0
  Médiathèque   All                          23610694.0
                DVD                           3710341.0
                Disque compact                1684356.0
                Disque microsillon             338976.0
                Livre                        15731162.0
                Livre en gros caractères       514064.0
                Livre sonore                   595185.0
                Périodique                    1036610.0
  Zèbre         All                            800167.0
                DVD                            192799.0
                Disque compact                      0.0
                Disque microsillon                  0.0
                Livre                          607368.0
                Livre en gros caractères            0.0
                Livre sonore                        0.0
                Périodique                          0.0
  All           All                          24711251.0
                DVD                           3903140.0
                Disque compact                1684356.0
                Disque microsillon             338976.0
                Livre                        16638920.0
                Livre en gros caractères       514064.0
                Livre sonore                   595185.0
                Périodique                    1036610.0**
  </code></pre>