Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Displaying the categories in different columns
print("Unique categories in the column 'pregnant'", dataset['pregnant'].unique())
print("Count of categories in the column 'pregnant' \n", dataset["pregnant"].value_counts())
print("\nUnique categories in the column 'T3 measured'", dataset['T3_measured'].unique())
print("Count of categories in the column 'T3 measured' \n", dataset["T3_measured"].value_counts())
print("\nUnique categories in the column 'Gender'", dataset['Gender'].unique())
print("Count of categories in the column 'Gender' \n", dataset["Gender"].value_counts())
# Replacing the categorical values into binary values
dataset = dataset.replace({'f':0,'t':1, 'y':1, 'n':0, 'M':0, 'F':1})
# Displaying the head of the dataset
dataset.head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment