data$GroupId = paste( data$Surname, data$Pclass, sub('.$','X',data$Ticket), data$Fare, data$Embarked, sep='-')
Output: Output of the following code
This should work
data['GroupId'] = data['Surname'] + data['Pclass'].astype(str).str.replace('$', 'X') + '-' + data['Fare'].astype(str) + data['Embarked'].astype(str)
I don't know types of your dataframe so I converted them all to strings.
If you want to see more see this so question