Home > Blockchain >  Can anyone explain me what actually the value inside third brackets / [2] after str.split("|&qu
Can anyone explain me what actually the value inside third brackets / [2] after str.split("|&qu

Time:03-28

df1["state"] = df1["place_with_parent_names"].str.split("|",expand=True)[2]

what [2] actually indicate of a string split method.

CodePudding user response:

A enter image description here

enter image description here

CodePudding user response:

the split function return a list so [2] is the index of the required string

  • Related