Change string type blank cells to 0 using str.replace
Hi,
In lesson 3.2, the following codes does not work. Any ideas?
loan_data['emp_length_int'] = loan_data['emp_length_int'].str.replace("N/A",str(0))
Thanks,
Jo Zhou
2 answers ( 0 marked as helpful)
Hi Jo,
thanks for reaching out! Would you be able to provide a screenshot of your code along with the error message you're receiving? It might help narrow the problem down.
Thanks in advance!
Best,
365 Eli
Hi Elitsa,
After using replace N/A, I still encounter NaN. You can see the image below. Thank you.
