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.
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.
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.
Data science, statistics, machine learning, and AI
These terms overlap, but they do not mean exactly the same thing.
| Field | Typical purpose | Simple example |
|---|---|---|
| Statistics | Estimate relationships, quantify uncertainty, and test claims using data and assumptions. | Estimate the difference between two group means. |
| Machine learning | Learn patterns from data to predict, classify, or discover structure. | Predict a measurement from several input features. |
| Artificial intelligence | Develop systems that perform tasks associated with intelligent behaviour. | Use an agent to organize and review an analysis, with human verification. |
| Data science | Integrate 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.
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.
| Group | Plant IDs | Growth values (mm) | Mean (mm) |
|---|---|---|---|
| Control | C1–C6 | 12, 13, 11, 14, 10, 12 | 12.00 |
| Treatment | T1–T6 | 15, 14, 16, 14, 17, 15 | 15.17 |
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.
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:
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.
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.
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.
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.
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
- pandas: How to calculate summary statistics. A beginner-friendly reference for the grouped summaries used above.
- Matplotlib: Scatter plot documentation. A technical reference for plotting individual observations.
- scikit-learn: Common pitfalls and recommended practices. Useful preparation for the later machine-learning lessons.
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