I want to create a new column in Pandas using a string sliced for another column in the dataframe.
For example.
Sample Value New_sample
AAB 23 A
BAB 25 B
Where New_sample
is a new column formed from a simple [:1]
slice of Sample
I've tried a number of things to no avail - I feel I'm missing something simple.
What's the most efficient way of doing this?