title: Jupyter/ipywidgets sorting dataframe on two levels
body: <p>Google has failed me, so hopefully someone can help me out.</p>
  
  <p>I'm working with a Jupyter notebook.  I have a dataframe and am trying to setup interactive widgets to sort that dataframe.  </p>
  
  <p>The dataframe is about athletes.  I am trying to sort the dataframe by athlete name, and then sort that by the disciplines that athlete competes in.  So, I want to be able to select "Jon", and then after selecting "Jon", I want to be able to narrow down the data returned so that I can look at "Jon's" Triple Jump (and only triple jump) if selected, but be able to switch over to look at "Jon's" Long Jump results if I select that.</p>
  
  <pre><code>data = pd.read_csv("Athlete Rank Moments.csv", encoding = "latin-1", usecols = [0, 1, 2, 4, 5, 16], 
                 parse_dates = True, infer_datetime_format = True)
  data["RankDate"] = pd.to_datetime(data["RankDate"], errors="coerce")
  
  items = ['All']+sorted(data["Person/Team"].unique().tolist())
  discipline_items = ['All']+sorted(data["Discipline"].unique().tolist())
  
  
  def view(x='', y=''):
      if x == 'All': return data
      return data[data['Person/Team','Discipline']==x]
  
  
  w = widgets.Select(options=items)
  z = widgets.Select(options = discipline_items)
  v = interact(view, x=w, y=z)
  display(v)
  </code></pre>
  
  <p>This code gives me two drop down menus, but the drop down menu for the "discipline_list" doesn't alter the data returned at all.  OBviously, this is because the view function doesn't do anything with it, but I don't know what to write in the view function to get the result I want.  ANy help would be appreciated!</p>