How to extract a substring from column and add it back as new column.
For example, I have file1 with 2 column. I want extract first 3 character from fullname column and then I need to add it as new column.
I need below output
Is below is correct way of doing this.
df = pd.read_csv('File1', sep='|')
df['ShortName'] = df['FullName'].str.slice[0:3]