title: Dataframe to print rows of same index to 1 line
body: <p>Simple dataframe as below, and I want to print the rows of the same index in 1 sorted line.</p>
  <p>Wanted:</p>
  <pre><code>123@1st line; 2nd line; 3rd line; 4th line 
  456@a1st line; a2nd line; a3rd line
  </code></pre>
  <p>I've tried:</p>
  <pre><code>import pandas as pd
  from io import StringIO
  
  csvfile = StringIO(
  &quot;&quot;&quot;Group    Sort    String
  123 207 1st line
  123 208 2nd line
  123 209 3rd line
  123 210 4th line
  456 625 a1st line
  456 626 a2nd line
  456 627 a3rd line&quot;&quot;&quot;)
  
  df = pd.read_csv(csvfile, sep = '\t', engine='python')
  
  df['Group'] = df['Group'].astype(str)
  df['Sort'] = df['Sort'].astype(int)
  df = df.sort_values(['Sort'], ascending=[True])
  
  df_1 = df.groupby(['Group'])['String'].apply(lambda x: '; '.join(x.astype(str))).reset_index()
  
  df_1['String'] = df_1['String'].str.split('; ').apply(set).str.join('; ')
  
  for index, row in df_1.iterrows():
      print(row['Group'] + '@' + row['String'])
  </code></pre>
  <p>But the output is:</p>
  <pre><code>123@3rd line; 4th line; 1st line; 2nd line
  456@a3rd line; a2nd line; a1st line
  </code></pre>
  <p>Where went wrong and how can I correct it?</p>