title: Querying a dataframe using tkinter checkbox
body: <p>I'm very new to python and especially Tkinter.</p>
  <p>I want to build a GUI to pick rows from a panda dataframe. I've built the GUI and the row search tool, but can't link them together. The dataframe is a column of months and a column of numbers. (Months can be repeated.) I want to click `January' on the GUI and get the sum of the January numbers.</p>
  <p>I imported the dataframe as df before running the following code.</p>
  <pre><code>from tkinter import *
  root = Tk()
  
  listbox_frame=Frame(root,borderwidth=5, relief=SUNKEN)
  listbox_frame.pack(pady=12)
   
  listbox=Listbox(listbox_frame, height=12)
  listbox.pack()
  
  listbox.insert(END,&quot;January&quot;)
   
  for item in [&quot;February&quot;, &quot;March&quot;, &quot;April&quot;, &quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;August&quot;, &quot;September&quot;, &quot;October&quot;, &quot;November&quot;, &quot;December&quot;]:
      listbox.insert(END, item)
   
  def list_item_selected():
      selection=listbox.curselection()
      if selection:
          print(listbox.get(selection[0]))
   
  list_box_button = Button(listbox_frame,text='Select Month', command=list_item_selected)
  list_box_button.pack()
  
  root.mainloop()
  
  df.loc[(df['Month'] == list_item_selected), ['Amount']].sum()
  </code></pre>
  <p>I didn't include the dataframe in the above. A dummy head looks like this:</p>
  <pre><code>     Month     Amount
  0   January      1
  1   January      1
  2   January      1  
  3   February     2
  4   February     2
  </code></pre>
  <p>Any suggestions would be much appreciated.</p>
  <p>Thanks</p>