
Want to retrieve from a string column in your Python Pandas data frame? Use .str.get:
df['a'].str.get(0) # one character
df['a'].str.get(i) # using an index variable
But wait: You can use [], in place of .get:
df['a'].str[0] # alt syntax!

Want to retrieve from a string column in your Python Pandas data frame? Use .str.get:
df['a'].str.get(0) # one character
df['a'].str.get(i) # using an index variable
But wait: You can use [], in place of .get:
df['a'].str[0] # alt syntax!