I have a column containing strings in this format:
/* [MCCOOK 0 ] */,999990,'MCCOOK 0 '
I want to extract the substring between [ and ] into another column. Please advise.
I have a column containing strings in this format:
/* [MCCOOK 0 ] */,999990,'MCCOOK 0 '
I want to extract the substring between [ and ] into another column. Please advise.
As suggested in this answer https://stackoverflow.com/a/16842576/9754169 you can use the apply
approach
your_column.apply(lambda st: st[st.find("[")+1:st.find("]")])