I am new in Python and I would like to extract a certain kind of string data from my data frame. Here is my data frame:
I want to extract the first letter in the cabin column(like A,B,C,D...) and add it as a new feature column named as CabinCapital in the data frame. How could I do it? For instance, row 460 should have a feature CabinCapital which contains a letter "E".(if the cabin value is empty("NAN"), the cabinCapital is empty as well)