pandas column string first n characters

36

df1['StateInitial'] = df1['State'].str[:2]
print(df1)  

Comments

Submit
0 Comments