Encode Categorical Data
Discover the basics of categorical data and how to encode it in pandas.
Overview of categorical data
Beyond numerical data, categorical data is another data type that is commonly seen in real-world datasets. Categorical data refers to data that can be divided into distinct groups based on specific characteristics and take on a limited number of unique values. It can be distinguished into two general types:
Nominal categorical data is where there is no order or ranking between categories. Examples of nominal data include gender, blood type, and hair color.
Ordinal categorical data is where the categories can be ordered or ranked. Examples of ordinal data include educational degrees (e.g., high school, bachelor's, master's), income groups (e.g., low, medium, high), and star ratings (e.g., one star to five stars). ...
Categorical data in pandas
Get hands-on with 1400+ tech skills courses.