Reputation: 339
I have a data frame and in the second column there are strings. I can get the second column a number of ways:
df.iloc[:,1]
df.ix[:,1]
df['column_name']
and I can get certain rows by indexing further, df.iloc[:,1][:4]
But what I can't seem to do is slice every string at once in the column.
Something like df.iloc[:,1][:][1]
returns the first row of the column but df.iloc[:,1][1][1]
does actually give me a slice. How do I apply this to all rows of the column without a for loop?
Upvotes: 1
Views: 3075