Thank's a lot for your answers, you help me !
I use this code :
result=[]
for i, j in itertools.combinations(df["PORT CODE"], 2):
if i!=i+1:
result.append(f'{i}_{j}')
dff=pd.DataFrame(result)
I need you for the next step :
First column is the Port and the 2nd the service.
I want concatenate i and i+1 if the service is different. In this case, the result is :