Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df_auto['Kilometers'] = df_auto['Kilometers'].str.extract('(\d+\.?\d*)', expand=False).astype(int)
- #########################################################
- df_jobs['Salary to'] = df_jobs['Salary'].str.findall(r'([-+]?\d*\.\d+|\d+)').str[-1]
- df_jobs['Salary from'] = df_jobs['Salary from'].astype(float)
- ###########################################################
- df_auto['Kilometers_test'] = df_auto['Kilometers'].str.extract('(\d+\ \d*)', expand=False) # 40 000
- df_auto['Kilometers_test'] = pd.to_numeric(df_auto['Kilometers_test'].str.replace(" ", ""), errors = 'coerce')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement