xxxxxxxxxx
import numpy as np
df['first_five_Letter']=df['Country (region)'].str.extract(r'(^\w{5})')
df.head()
xxxxxxxxxx
S=pd.Series(['Finland','Colombia','Florida','Japan','Puerto Rico','Russia','france'])
S.str.contains('^F.*')
xxxxxxxxxx
S=pd.Series(['Finland','Colombia','Florida','Japan','Puerto Rico','Russia','france'])
[itm[0] for itm in S.str.findall('^[Ff].*') if len(itm)>0]
xxxxxxxxxx
# Get countries starting with letter P
S=pd.Series(['Finland','Colombia','Florida','Japan','Puerto Rico','Russia','france'])
S[S.str.match(r'(^P.*)')==True]