• Navid Nassiri

Exploring the 4 types of data


When dealing with data automation, it’s important to understand data types and structures. In the broadest sense, there are two types of data.


Quantitative data is numerical, consisting of values, such as quantity or percentage. Whereas qualitative data is used to describe everything else, and often consists of labels used to describe different features, such as color or category, although it can also include images, audio, and symbols.


However, this simple dichotomy can be further broken down into the four main categories of data, so let’s take a look.


What are the 4 types of data?


1. Nominal data

Since qualitative data deals with categories, this type of data is also referred to as ‘categorical’. Nominal data is a type of qualitative data that is used for labels which lack any order or sequence, such as nationality or eye color. It doesn’t provide any quantitative value.


2. Ordinal data

The other category of quantitative data is ordinal data. This presents an order or sequence that has relative positions, such as letter grades (A, B, C, etc.) or education level (pre-school, elementary, middle, high, and college). Since ordinal data implies some kind of numbering, you can think of this kind of data as bordering the qualitative and quantitative types. Ordinal data may or may not be amenable to arithmetic operations, such as addition and averaging. For example, you probably couldn’t produce a useful mean average from education levels, but you could produce this from customer satisfaction results ranked on a scale from 1 to 10.


3. Discrete data

Discrete data is quantitative data that can only take certain values. The data points don’t need to be integers or whole numbers, but they do need to be quantized to indivisible levels, such as clothing size or units produced.


4. Continuous data

The other type of quantitative data is continuous data. This kind of data can take any value from an unlimited range, such as time taken or product price. Whereas discrete data can be represented by a bar graph, continuous data can be represented by a histogram.


What are the types of data in Python?


Python is a programming language with a plethora of different uses. But it has found particular success in data automation, partly due to its ability to quickly create and manage data structures. Here are the seven different types of data structure in Python.


1. Number

Numbers can be defined as integers, floating point numbers, or complex numbers. These are defined as ‘int’, ‘float’, and ‘complex’, respectively. Complex numbers take the form A+Bj, where ‘A’ and ‘B’ are regular numbers, and ‘j’ designates ‘B’ as the imaginary part.


2. List

This is an ordered sequence of items, for example [1,2,3,‘text’], where the numbers and the word “text” are items in the list. Python allows you to add values of different data types to lists.


3. Tuple

A tuple is a list that is fixed and cannot be modified, the purpose being to write-protect the data contained within it. Another advantage is that they can be processed faster. An example of a tuple would be (1,2,3,‘text’).


4. String

Strings are sequences of unicode characters, typically used to contain text, and are denoted using single or double quotation marks, as in ‘a string’ or “another string”. If the text contains a single quotation or double quotation character, then curved brackets are used as escape characters, such as in ‘A single quotation mark looks like this: (‘)’, or “A double quotation mark looks like this: (“)”. Like tuples, strings cannot be modified or deleted in Python.


5. Set

A set is an unordered sequence of items. An example of a set would be {1,2,3}, where each number is an item. Any duplicate values are eliminated, so {1,2,2,3,3,3} would become {1,2,3}.


6. Dictionary

Dictionaries are used to store data so that values are paired to ‘keys’, which can be thought of as fields. For example, {“brand”: “Lenovo”, “CPU”: “Core i5”, “GPU”: “RTX 3060”}. Items are ordered, and each is stored in a “key”:”value” pair. Dictionaries are useful for inputting a large volume of data and can be modified, but duplicates are not allowed.


7. Boolean

There can only be one of two values in a Boolean: true or false. This takes the form of type(True) and type(False).


To gain a greater understanding of data and how to automate the different types, check out our ultimate guide. Switchboard provides a turnkey data unification and automation platform, so you can outsource your data needs to gain better results. Contact our team to learn more.