Introduction
A dataset is an organized collection of related data values that describes a set of observations, typically arranged in tabular form so that each row corresponds to one observation, or record, and each column corresponds to one variable, or attribute, measured consistently for every observation. Before any statistical analysis or visualization can happen, the raw values collected from a survey, a sensor, a transaction log, or an experiment must first be shaped into this row-and-column structure so that comparisons across observations are meaningful.
Cricket analogy: A scorecard for a One Day International is itself a dataset: each row is one batter's innings and each column is a fixed attribute like runs, balls faced, fours, and sixes, so that Batter A's 45 off 38 balls can be compared directly against Batter B's 30 off 40 balls in the same columns.
Explanation
Datasets vary in how strictly they are organized. A structured dataset, such as a spreadsheet or a database table, fits neatly into rows and columns with a defined type for each column. Semi-structured data, like a folder of JSON records with slightly different fields per record, has some organization but not a rigid uniform shape. Unstructured data, such as free-text reviews or photographs, has no predefined rows and columns at all and must be processed before it can be analyzed like a structured dataset. Within a structured dataset, each column also has a variable type: categorical variables hold labels or categories, like a team name or a color, while numerical variables hold measured quantities, like a score or a temperature, that support arithmetic.
Cricket analogy: A completed scorecard is fully structured with fixed columns for every batter, but a stack of handwritten umpire notes about unusual incidents is unstructured text that must be read and coded into columns before it can sit in the same dataset as the scorecard's structured numbers.
Example
import pandas as pd
df = pd.read_csv('survey_responses.csv')
# Preview the first rows
print(df.head())
# Check column names and data types
print(df.dtypes)
# Count missing values per column
print(df.isna().sum())Analysis
Running a quick inspection on a dataset, such as calling a summary function that lists column names, data types, and a preview of the first few rows, reveals whether the data is already well-structured or needs cleaning before analysis. For example, a column expected to hold numbers but stored as text signals that values need to be converted, and columns with many missing entries signal that decisions about handling missing data are needed before computing any statistics on the dataset.
Cricket analogy: Reading through a newly received scorecard before analysis, a scorer checks that the 'runs' column is really numeric and not stored as text, and flags any innings with blank entries, the same inspection a dataset needs before any statistic is trusted.
Key Takeaways
- A dataset is an organized collection of observations, usually arranged as rows (records) and columns (variables).
- Structured data fits cleanly into rows and columns; semi-structured data has some organization; unstructured data, such as free text or images, has none until processed.
- Categorical variables hold labels or categories; numerical variables hold measurable quantities.
- Inspecting column data types and missing values is a necessary first step before computing any statistics.
- Consistent columns across all rows are what make one observation comparable to another.
Practice what you learned
1. What best describes a dataset?
2. Which type of data has no predefined rows and columns until it is processed?
3. Which variable type holds measured quantities that support arithmetic, such as a temperature?
4. Why should a dataset's column data types be inspected before computing statistics?
Was this page helpful?
You May Also Like
Descriptive Statistics
An overview of descriptive statistics, the measures of central tendency and spread used to summarize a dataset's key numerical patterns.
Mean, Median, Mode
A comparison of the mean, median, and mode as measures of central tendency, and why the mean is more sensitive to outliers than the other two.
Data Visualization Basics
An introduction to choosing chart types for data analysis and avoiding common visual distortions like truncated axes.