I have code as below.
def putTogether(self, createCol, fisrtCol, secondCol):
self.data[createCol] = self.data[fisrtCol].map(str) + '_' + self.data[secondCol].map(str)
return self.data
This will return strings put together. As an example, I_U. But the number of columns doesn't always have to be 2. It can be arbitrary. So I would like to make it with *args for the flexibility.
So ideally, I wish it to be a form below.
def putTogether(self, createCol, *args):
...
return self.data
Would you someone help me out with this when *args is not in for loop?
Thank you in advance.