I would like to split this string A->B->C->D->E->F into substrings as A->B,B->C,C->D,D->E,E->F.
I tried using split and the delimiter as '->' but that doesn't give the output in the way I want. Would really appreciate some help here!
I have multiple such values in a column in a dataframe. I would like to create as many new columns as the max number of splits and then store each split in the respective column in the dataframe. Desired output
You can use
str.split,itertools.pairwise,mapandstr.join:Output:
Similar logic if you have a Series/DataFrame: