Ordinal data consists of categories with a meaningful order: each value comes before or after another. Ratings, rankings, and ordered levels fit this type. Although values are often stored as integers, they are not automatically ordinary numeric measurements. section 2.1.2
The gaps between adjacent ranks need not be equal. First and second place may be seconds apart while second and third are minutes apart, so calculating a mean or standard deviation can make an unjustified numeric approximation. Treat ordinal values as categorical features that retain order. section 2.1.2
Identify an ordinal column by checking whether its values express an ordered progression rather than merely distinct labels:
- Product star ratings and ranked competition places are ordered values. section 2.1.2
- Likert-style responses, from “strongly disagree” through “strongly agree,” express ordered levels even when stored as strings. section 2.1.2
- In vehicle data, cylinder count can be treated as ordinal when more cylinders generally correspond to greater engine power; model year can represent time progress. section 2.4.2
Inspecting ordered vehicle attributes
Start by counting distinct values in each column. A small set of integer values does not settle its type: domain knowledge distinguishes cylinder count as an ordered feature from origin as a categorical one. Ordered value counts can then reveal how observations are distributed across model years. section 2.4.2
Table 2.1 Types of data in a tabular dataset (view table figure)
| Type |
Description |
|---|---|
| Numeric features |
Integers for count data, such as when enumerating sales by day for a product: [105, 122, 91, … 124] Floats for measurements, such as when enumerating sales income by day for a product: [1000.50, 1230.00, 950.80, …, 1200.00 ] |
| Ordinal features |
Integers (or floats without decimals) for rankings or ordered levels: [0, 1, 2, 3, …, 999] Sometimes ordinal features can be verbally expressed by strings underling some ordered effect such as with Likert-like agreement or preference scales: [“strongly disagree,” “disagree,” “neither agree nor disagree,” “agree,” “strongly agree”] |
| Low categorical features |
Since they express a quality, they can be a string (called “labels”) or integers associated with the original labels; in that case you have a conversion dictionary available: {0: “red,” 1:”green,” 2: “blue”} |
| High categorical features |
The same as low categorical features but with a large number of label (e.g., US area codes or zip codes: https://postal-codes.net/united-states) |
| Dates |
They can be a string or already encoded in data formats such as “2022-03-04”, “Feb 15, 1957 11:45 PM” or “6/12/2022” (there are many date standards and conventions) |
Compare ordinal values with numeric and categorical column types, including ranked integers and ordered agreement labels. section 2.1.2







