I am looking to find the no of alphabets in a mixed column in a pandas df. If the no of alphabets is more than 2, keep the two alphabets nearest to the number.
I am trying to get count using the below
df['count'] = len(re.findall('[a-zA-Z]', a['MyCOlumn']))
but get the below error:
TypeError: expected string or bytes-like object
Input
ABAB5395
DC5395
ABCD1234
Output
AB5395
DC5395
CD1234