I have a dataset as below:
我有一个数据集如下:
df=pd.DataFrame([["Sam is 5", 2000],["John is 3 years and 6 months",1200],["Jack is 4.5 years",7000],["Shane is 25 years old",2000]], columns = ['texts','amount'])
print(df)
texts amount
0 Sam is 5 2000
1 John is 3 years and 6 months 1200
2 Jack is 4.5 years 7000
3 Shane is 25 years old 2000
df=pd