0

I have a dataset with many missing values in Gender.

The path I took, which is probably not the best is first creating a variable with the genders.

Gender = dataset['Gender'].isin(['M', 'F'])

And now merging this series with the dataframe.

dataset1 = pd.DataFrame.merge(dataset, Gender)

This of course, it´s not working.

How can I solve this? Ty

1
  • 2
    I think you simply need this: dataset.dropna(subset=['Gender'], inplace=True) Commented Sep 11, 2021 at 9:36

1 Answer 1

1

Do you mean by?

dataset.loc[dataset['Gender'].isin(['M', 'F'])]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.