There are other similar questions, but the difference here is that my dataframe already has a lot of columns, only one of which needs to be split.
I have a large dataframe(hundreds of columns, millions of rows). I would like to split one of these columns when a character ("|") is found in the string.
All values have only one "|".
For a fixed length I would do this: df['StateInitial'] = df['state'].str[:2]
I wish I could replace the 2 by string.index("|"), but how do I call the string?