Last answered:

12 Dec 2022

Posted on:

31 Jan 2021

0

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)
Instructor
Posted on:

01 Feb 2021

0

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

Posted on:

12 Dec 2022

0

Hi Elitsa,
After using replace N/A, I still encounter NaN. You can see the image below. Thank you.

image.png

Submit an answer