title: group by with python and streamlit
body: <p>i have the below dataframe i want to filter the dataframe and return result based on the user selection from a <strong>multiselectbox</strong> , <strong>and grouped by name</strong></p>
  <p>the selectbox is the unique value of <strong>name</strong> field</p>
  <pre><code>import streamlit as st
  import pandas as pd
  
      data = {
           'ID': [1, 2, 3, 4],
           'name': ['peter', 'john', 'james', 'james'],
           'nickname': ['pet', 'jon','james', 'jem'],
           'mother_name': ['maria', 'linda', 'ana', 'beth'],
           'bd': ['2000-05-15', '2006-09-12', '2004-10-25',]    
       }
      
      with st.sidebar.form(key='search_form',clear_on_submit= False):
      choices =df[&quot;name&quot;].unique().tolist()
      regular_search_term = st.multiselect(&quot; &quot;,choices)
      
      if st.form_submit_button(&quot;search&quot;):
         df_result_search=df[df[&quot;name&quot;].isin(regular_search_term)]
         df_group = df_result_search.groupby('name')
      
         st.write(df_group)
  </code></pre>
  <blockquote>
  <p>if i select <strong>james</strong>  it return the 2 records while i need to return
  1 record  that includes the 2 data related to <strong>james</strong></p>
  </blockquote>
  <p>how can i return this result.</p>