pandas column string first n characters

Solutions on MaxInterview for pandas column string first n characters by the best coders in the world

showing results for - "pandas column string first n characters"
Jacobo
19 Oct 2020
1df1['StateInitial'] = df1['State'].str[:2]
2print(df1)  
3