df1["state"] = df1["place_with_parent_names"].str.split("|",expand=True)[2]
what [2] actually indicate of a string split method.
CodePudding user response:
CodePudding user response:
the split function return a list so [2] is the index of the required string