Data Science & Machine Learning Foundations · Lesson 01 of 06

What Is Data Science?
From Raw Data to Reliable Conclusions

Data science is not simply about writing Python code or training a machine-learning model. It is about asking useful questions, understanding the data, finding meaningful patterns, and recognizing what the evidence can and cannot tell us.

Beginner 12–15 minute lesson Includes Python example By Taufia Hussain, PhD

By the end of this lesson, you will be able to:

  • Explain what data science actually involves.
  • Recognize the steps between data collection and interpretation.
  • Explore a small dataset using Python.
  • Distinguish a numerical pattern from a reliable conclusion.
01 / THE IDEA

What is data science?

Imagine that a research team collects growth measurements from plants, a hospital records patient observations, or a company measures how people use its service. Each produces data. But collecting measurements is only the beginning.

The real task is to understand which questions those data can answer. Are the measurements reliable? Do the groups differ? Could another factor explain the apparent pattern? What should we measure next?

Data science combines quantitative reasoning, computing, domain knowledge, and communication to turn data into useful evidence for questions and decisions.

Python and machine learning are useful tools within data science. They are not its definition. Sometimes a carefully designed plot or a simple statistical summary answers the question more reliably than a sophisticated algorithm.

Where does bio-data science fit?

Biological data science applies the same principles to biological questions. Examples include gene expression, microscopy, animal behaviour, physiological signals, chemical measurements, and ecological observations. The tools may be similar, but the biological context changes how the measurements should be analysed.

02 / THE PROCESS

From raw measurements to an answer

Good analysis follows a logical process. The steps below are not always strictly linear. Researchers often return to earlier stages when they discover an unexpected value or a problem with the experimental design.

STEP 01Define the questionWhat do we need to know?
STEP 02Understand the designWhat was actually measured?
STEP 03Audit the dataAre values complete and credible?
STEP 04ExploreWhat patterns and anomalies appear?
STEP 05Analyse or modelWhich method fits the question?
STEP 06ValidateCould the result be misleading?
STEP 07InterpretWhat does the evidence support?
STEP 08CommunicateWhat should others know?

Notice that modelling appears only after the question, design, data quality, and exploratory analysis. Choosing an algorithm too early can produce a technically impressive answer to the wrong question.

03 / THE TOOLS

Data science, statistics, machine learning, and AI

These terms overlap, but they do not mean exactly the same thing.

FieldTypical purposeSimple example
StatisticsEstimate relationships, quantify uncertainty, and test claims using data and assumptions.Estimate the difference between two group means.
Machine learningLearn patterns from data to predict, classify, or discover structure.Predict a measurement from several input features.
Artificial intelligenceDevelop systems that perform tasks associated with intelligent behaviour.Use an agent to organize and review an analysis, with human verification.
Data scienceIntegrate relevant methods with data handling, context, and communication.Assess a research question from raw data to a defensible interpretation.

The best method depends on the goal. If you need to describe your sample, start with descriptive statistics. If you need to estimate an effect, consider the study design and inferential methods. If you need to make predictions for new cases, machine learning may be appropriate.

04 / WORKED EXAMPLE

Can we learn something from twelve plants?

Consider a fictional teaching dataset. Twelve independently grown plants are assigned to two groups. Six receive a control condition and six receive a treatment. The response is growth in millimetres over a fixed interval. For simplicity, we assume one measurement per plant and no missing observations.

GroupPlant IDsGrowth values (mm)Mean (mm)
ControlC1–C612, 13, 11, 14, 10, 1212.00
TreatmentT1–T615, 14, 16, 14, 17, 1515.17
All values are invented for teaching. They do not represent an actual experiment or a published result.
Fictional plant growth measurements by group Six measurements per group. Control values: 12, 13, 11, 14, 10, 12 millimetres, mean 12. Treatment values: 15, 14, 16, 14, 17, 15 millimetres, mean approximately 15.17. Individual points and horizontal mean lines shown. Plant growth (fictional data) Each dot is one independently grown plant 1012141617 mean 12.00 mean 15.17 Control Treatment Growth (mm) Dots = observations · Lines = group means
Showing every observation makes the small sample size visible. A mean alone would hide that information.

The treatment group has a higher observed average. The difference is approximately 3.17 mm. But that number is a description of this small example, not proof that the treatment caused greater growth.

Before making a stronger claim, we would need to examine the randomization, growing conditions, measurement process, possible confounding, uncertainty, and whether the result holds across independent repetitions.

05 / TRY IT IN PYTHON

Explore the same data with Python

You can run the example below in a Jupyter notebook, Google Colab, or Kaggle notebook. It uses pandas for a small data table and matplotlib for visualization. Both are widely used Python libraries.

If needed, install them in your environment using pip install pandas matplotlib. Then run the code:

Python · complete runnable example
import pandas as pd
import matplotlib.pyplot as plt

# Synthetic observations from 12 independent plants.
data = pd.DataFrame({
    "plant_id": [f"C{i}" for i in range(1, 7)]
                + [f"T{i}" for i in range(1, 7)],
    "group": ["Control"] * 6 + ["Treatment"] * 6,
    "growth_mm": [12, 13, 11, 14, 10, 12,
                  15, 14, 16, 14, 17, 15],
})

# Inspect the data before interpreting it.
print("Missing values by column:")
print(data.isna().sum())
print("Unique plants:", data["plant_id"].nunique())

summary = (
    data.groupby("group", sort=False)["growth_mm"]
        .agg(n="count", mean="mean", sd="std")
        .round(2)
)
print("\nGroup summaries:")
print(summary)

# Plot individual observations and group means.
fig, ax = plt.subplots(figsize=(7, 4))
for position, (name, group_data) in enumerate(
    data.groupby("group", sort=False)
):
    y = group_data["growth_mm"].to_numpy()
    offsets = [(-0.1 + 0.04 * i) for i in range(len(y))]
    x = [position + offset for offset in offsets]
    ax.scatter(x, y, s=65, alpha=0.85, label=name)
    ax.hlines(y.mean(), position - 0.18, position + 0.18,
              linewidth=3)

ax.set_xticks([0, 1], ["Control", "Treatment"])
ax.set_ylabel("Growth (mm)")
ax.set_title("Fictional plant-growth observations")
ax.spines[["top", "right"]].set_visible(False)
fig.tight_layout()
plt.show()

mean_difference = (
    summary.loc["Treatment", "mean"]
    - summary.loc["Control", "mean"]
)
print(f"Observed mean difference: {mean_difference:.2f} mm")
print("A descriptive difference is not proof of causation.")

Expected summary (rounded to two decimal places)

           n   mean    sd
Control    6  12.00  1.41
Treatment  6  15.17  1.17

Observed mean difference: 3.17 mm

What does the code do? First, it checks for missing values and counts distinct plant IDs. It then calculates the number of observations, mean, and standard deviation for each group. Finally, it plots the individual measurements and group averages.

We did not train a machine-learning model. We did not need one. The first goal was to understand the measurements and what they can reasonably tell us.

An important technical distinction

The code calculates the difference using rounded group means, so it prints 3.17 mm. The unrounded difference is approximately 3.1667 mm. That is a display choice, not a scientifically meaningful change.

06 / SCIENTIFIC JUDGEMENT

When should we trust a result?

Data science can produce a clear figure or a precise number even when the underlying evidence is weak. Before accepting a result, ask a few questions.

  • What is one independent observation? Ten measurements from the same plant do not automatically represent ten independent plants.
  • Are any values missing or unreliable? Missingness can be systematic rather than random.
  • Could another variable explain the pattern? Temperature, batch, timing, and selection effects can distort comparisons.
  • How uncertain is the result? Small samples often leave substantial uncertainty, even when group means differ.
  • Would the conclusion survive new data? Replication and appropriate validation matter more than an attractive chart.

The same principles apply to machine learning. A model can achieve high accuracy for the wrong reasons, including data leakage, duplicated observations, or an evaluation method that does not reflect its intended use.

Three ideas to remember

  • Start with the question and study design, not a preferred algorithm.
  • Use Python and visualization to inspect evidence, not only to produce output.
  • Distinguish observation, prediction, and causation. They support different kinds of claims.
07 / YOUR TURN

Try a short reasoning exercise

Question 1

A researcher measures five leaves on each of four plants. The spreadsheet contains 20 rows. How many independent plants were sampled?

Reveal explanation

Four plants. The twenty leaf observations may be useful, but measurements within a plant can be correlated. The appropriate analysis depends on the question and the sampling design.

Question 2

In the fictional dataset, the treatment group has a larger mean. Can we immediately conclude that the treatment causes greater growth?

Reveal explanation

No. The difference is observed in this example. A causal interpretation requires a credible experimental design and attention to variation, uncertainty, and alternative explanations.

Optional Python challenge

Change the growth value for plant T6 from 15 to 25. Re-run the code. How do the mean, standard deviation, and plot change? Which summary becomes more sensitive to this unusually high value?

Hint

The mean and standard deviation will increase. Compare them with the median, and consider whether the new value reflects a genuine observation or a potential data-quality issue. Do not remove a value merely because it looks unusual.

08 / WHAT COMES NEXT

Build a stronger foundation

In this first lesson, we used an intentionally simple dataset to demonstrate what data science is really about. The next lesson will examine an important question that appears in almost every scientific and machine-learning project: What, exactly, is one observation?

We will look at samples, variables, experimental units, repeated measurements, and the difference between the number of rows and the amount of independent evidence.

For additional context, read What Is Bio-Data Science?, an earlier article by Taufia Hussain on Medium. This Learning Hub lesson is a new, self-contained educational treatment of the broader subject.

Further reading and official documentation

Keep learning with DataLens.Tools

All Learning Hub lessons are free.

Follow the complete foundations series and receive new lessons, scientific Python resources, and DataLens.Tools updates through DataLens Dispatch.

Subscribe free

Author: Taufia Hussain, PhD · DataLens.Tools

Editorial note: This page contains a fictional educational example. It is not a report of experimental findings. Future lessons will introduce additional methods and practical data challenges.

Explore the Learning Hub or follow new articles through DataLens Dispatch.