title: Crosstab on multiple columns
body: <p>I have a dataframe with a name, day, and location. For each name-day-location triple, I want to know what proportion of the rows with that name-day have that location.</p>
  
  <p>In code, I am starting with <code>df</code> and looking for <code>expected</code>.</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame(
      [
          {"name": "Alice", "day": "friday", "location": "left"},
          {"name": "Alice", "day": "friday", "location": "right"},
          {"name": "Bob", "day": "monday", "location": "left"},
      ]
  )
  
  print(df)
  
  
  
  expected = pd.DataFrame(
      [
          {"name": "Alice", "day": "friday", "location": "left", "row_percent": 50.0},
          {"name": "Alice", "day": "friday", "location": "right", "row_percent": 50.0},
          {"name": "Bob", "day": "monday", "location": "left", "row_percent": 100.0},
      ]
  ).set_index(['name', 'day', ])
  print(expected)
  </code></pre>
  
  <p>Printed:</p>
  
  <pre><code>In [13]: df                                                                                                                                                                                  
  Out[13]: 
        day location   name
  0  friday     left  Alice
  1  friday    right  Alice
  2  monday     left    Bob
  
  
  
  
  In [12]: expected                                                                                                                                                                            
  Out[12]: 
               location  row_percent
  name  day                         
  Alice friday     left         50.0
        friday    right         50.0
  Bob   monday     left        100.0
  </code></pre>