ValueError: Unable to parse string "10+ s" at position 0
Hi Sir,
Working through this project as you go along in your video, I noticed the errors below.
First I think I am geting mixed up with the notion of DataFrame. I have searched online for fixes but dont seem to fully understand what I am doing. According to our data, What is my dataFrame.
How do I solve the problem in the screenshot below? Are they other ways to go around this?
Hi Martin,
You need to replace "+ s" by blank. So the result could be: "10" so that you're able to convert this string into interger.
Hi Thai,
I think that is exactly what I have done please see my codes below. Please if the below is wrong kindly provide the exact codes let me try and see please.
Hi Martin,
I think the error you encounter stems from in the last two lines of your code. You can refer to the code of mine below. I hope it helps.
loan_data['emp_length_int'] = loan_data['emp_length'].str.replace('+', '')
loan_data['emp_length_int'] = loan_data['emp_length_int'].str.replace('< 1 year',str(0))
loan_data['emp_length_int'] = loan_data['emp_length_int'].str.replace('n/a',str(0))
loan_data['emp_length_int'] = loan_data['emp_length_int'].str.replace(' years','')
loan_data['emp_length_int'] = loan_data['emp_length_int'].str.replace(' year','')