import pandas as pd
d = {'element': ['COGS', 'Other current assets', 'COGS','COGS', 'Other current assets', 'COGS'], 'account_number': ['5721-ES', '1101', '5721-ESP', '73101L', '73230K', '11106' ]}
df = pd.DataFrame(data=d)
df
I need only the numbers without letters for converting them to numeric values afterwards.
However, I can't split these integers for instance 73101K
df.account_number = df.account_number.apply(lambda x: x.split('-')[0])