Python Vectorization Split String
Python Vectorization Split String Question: I want to use vectorization to create a column in a pandas data frame that retrieve the second/last part of a string, from each row in a column, that is split on ‘_’. I tried this code: df = pd.DataFrame() df[‘Var1’] = ["test1_test2","test3_test4"] df[‘Var2’] = [[df[‘Var1’].str.split(‘_’)][0]][0] df Var1 Var2 0 …