Types of Data
Numbers and categories.
Not every column is a number you can add up. A score of ninety is a number. But a city, like London, is a category. Knowing which type you have tells you which statistics make sense.

- Not every column is a number
- Numbers and categories
- Type decides the maths
The main types
Numerical data is measured with numbers. Continuous numbers can take any value, like height. Discrete numbers are counts, like number of children. Categorical data puts things into groups. Nominal categories have no order, like colours. Ordinal categories do, like small, medium, and large.
| Type | Example | Can you average it? |
|---|---|---|
| Continuous | height: 171.4 cm | yes |
| Discrete | children: 2 | yes |
| Nominal | city: London | no, count it |
| Ordinal | size: S, M, L | order, not average |
Why it matters for ML
Models only understand numbers. So categories have to be turned into numbers first. But be careful. If you code red as one, green as two, and blue as three, the model thinks blue is three times red. Instead, we usually make one yes or no column for each category. That's called one hot encoding.
| key | value |
|---|---|
| Models need | numbers |
| Bad idea | red=1, green=2, blue=3 |
| Better | one column per category |
| Name | one-hot encoding |
Summary
Data is numerical, either continuous or discrete, or categorical, either nominal or ordinal. The type decides what you can compute. Next, populations and samples.
Key takeaways- Continuous and discrete
- Nominal and ordinal
- One-hot for categories