Python counts from 0
, so for select 9th
values use str[8]
, compare by Series.eq
with L
and filter in boolean indexing
:
df1 = df[df['uid'].str[8].eq('L')]
print (df1)
uid maskeduid
0 VEH12345L0 72647hghghghg
1 VEH12323L3 hgh5454jjbjjb
3 VEH78345L3 12kjkkndw2knk
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…