code: def common_items(df):
      
      percentage = 0.1
  
      return (
          df
          .groupby(['idSegmento', 'idPlanilhaItens'])
          .count()
          .rename(columns={'PRONAC': 'itemOccurrences'})
          .sort_values('itemOccurrences', ascending=False)
          .reset_index(['idSegmento', 'idPlanilhaItens'])
          .groupby('idSegmento')
          .apply(lambda x: x[None: max(2, int(len(x) * percentage))])
          .reset_index(['idSegmento'], drop=True)
          .set_index(['idSegmento'])
      )
docs: Returns the itens that are common in all the segments,
      in the format | idSegmento | id planilhaItens |.