Mission 102-5: Data Cleaning Walkthrough Challenge: Consolidating Deaths

Screen Link:

My Code:

Replace this line with your code

What I expected to happen:

What actually happened:

Replace this line with the output/error

I was trying to work on a alternative “vectorized” solution for this task.
Briefly, I was trying to replace the “Yes” and “No” value with boolean True/False values and then add them in a function to apply to the dataframe and get the required information.
I tried both True/False and 1/0 as substitutes but the None/NaN values seem to stump the results and I get the values as NaN.
The information is too much to put here so I am uploading a notebook.
please look through and point out any errors/altenatives or conceptual errors.
Thank you.
m_102__5_data_cleaning_walkthrough_ challenge_cleaning_data.ipynb (26.9 KB)

Click here to view the jupyter notebook file in a new tab