Titanic survivor doubt

https://drive.google.com/file/d/1OaU5cyV7I4dPijrppr2fkRnwqGikOSB3/view?usp=sharing

i have used the data sets provided in the challenge itself …and in the boat column …i want to convert it into 0 and 1 …where there is a boat number - make it 1 …where blank …make it zero

hey @rohit_1906, this error occurred because some of rows did not contain any value, so first replace nan values in that column using fillna function of pandas dataframe and then use label encoder.

Hope this will resolve your doubt. :blush:

i know thats the error been shown but in that “boat” column i want to mark empty rows with 0 and rows with any value as “1”

Hey @rohit_1906, to fill that you can do it like this,

data[‘boat’].fillna(0,inplace = True)

data is your dataframe name. It can be different.

Hope this resolved your doubt. :blush:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.