PassaroBagante
PassaroBagante

Reputation: 99

Deleting rows for a given variable with missing values

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

Upvotes: 0

Views: 36

Answers (1)

U13-Forward
U13-Forward

Reputation: 71580

Do you mean by?

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

Upvotes: 1

Related Questions