import pandas as pd
df = pd.DataFrame(['$40,000*', '$40000 conditions attached'], columns=['P'])
print(df)
df['P'] = df['P'].str.replace('\\D+', '').astype('int')
print(df)
pandas applying regex to replace values