What Is Data Science?
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
This page was checked in October 2026. It sets the vocabulary for the rest of the Data Science section, whose hands-on pages target NumPy 2.5 (which needs Python 3.12 or later), pandas 3.1 and scikit-learn 1.9. Examples target Python 3.13 or 3.14 and were run on Python 3.13. Nothing here depends on a library version except the short code example, which was run on Python 3.13 and pandas 3.1.0. The next pages describe the workflow a project follows and the Python libraries that implement it.
A working definition
There is no single agreed definition, and the field’s own authors say so. Three definitions are useful in practice.
-
The R for Data Science book describes data science as an exciting discipline that turns raw data into understanding, insight and knowledge. Its emphasis is on a repeatable, programmable path from files and databases to a communicated result.
-
The Computational and Inferential Thinking textbook (the Berkeley Data 8 course) frames the field as the combination of computational thinking, which means programming and working with large data sets, and inferential thinking, which means drawing conclusions about the world from data that is always incomplete and noisy.
-
David Donoho’s essay "50 Years of Data Science" (2017) argues that the field is the science of learning from data, broader than statistics alone, and divides it into data gathering, preparation and exploration, data representation and transformation, computing with data, modeling, visualisation and presentation, and the study of data science itself.
Taken together: data science is the practice of using programming, statistics and domain knowledge to turn data into decisions, and to be honest about how reliable those decisions are. The last clause matters. A pipeline that produces a number is not data science until someone has asked how the number could be wrong.
Neighbouring disciplines
Data science overlaps several older fields. The labels are fuzzy, and one person often covers several of them, but the questions each field optimises for are different.
| Field | Main question | Typical output |
|---|---|---|
Statistics |
How certain can we be about a conclusion drawn from a sample? |
Estimates with uncertainty, hypothesis tests, experiment designs |
Machine learning |
Can a model predict well on data it has not seen? |
A trained model and its measured generalisation performance |
Data engineering |
How do we collect, store and move data reliably at scale? |
Pipelines, warehouses, schemas, data quality checks |
Business intelligence |
What happened, and how are the key figures moving? |
Dashboards and recurring reports built on curated data |
Data science |
What does the data tell us, and what should we do about it? |
Analyses, models and recommendations, usually delivered with code |
collect and store] --> DS ST[Statistics
inference and uncertainty] --> DS ML[Machine learning
prediction] --> DS DOM[Domain knowledge
the right questions] --> DS DS[Data science
analysis and models] --> BI[Business intelligence
reports and dashboards] DS --> DEC[Decisions and products]
Two distinctions are worth remembering.
-
Inference versus prediction. Statistics traditionally asks why: which factors influence the outcome, with what effect size and what uncertainty. Machine learning traditionally asks what next: which label or value will this new row have. A highly accurate model can be useless for explanation, and an interpretable model can predict poorly. State which goal a project has before choosing tools. The Machine Learning Fundamentals and Statistics Fundamentals pages develop each side.
-
Analysis versus production. A notebook that explains last quarter’s churn is an analysis. A model that scores every customer each night is a product with uptime, monitoring and ownership. The second one needs data engineering and the practices on Reproducibility and MLOps Basics.
The kinds of questions data science answers
Questions fall into a small number of families, and the family decides the method.
| Family | Example | Typical methods |
|---|---|---|
Descriptive |
How many orders did each customer place last year? |
Aggregation, summaries, charts |
Exploratory |
Are there groups of customers who behave alike? |
Visualisation, correlation, clustering |
Inferential |
Is conversion higher with the new checkout, or is the gap noise? |
Confidence intervals, hypothesis tests, bootstrap |
Predictive |
Which customers are likely to cancel next month? |
Supervised learning with honest validation |
Causal |
Did the discount cause the extra sales? |
Randomised experiments, careful observational designs |
Mechanistic |
How does a change in one input move the output in a physical or economic model? |
Simulation and domain models |
The ladder matters because a method from a lower rung cannot answer a higher rung’s question. A correlation found while exploring is not evidence of a cause, and a model that predicts well does not say what would happen if you intervened. The Exploratory Data Analysis page returns to this point.
Roles in a data team
Job titles vary by company, so treat the table as a map of activities rather than of people.
| Role | Focus |
|---|---|
Data analyst |
Answers business questions with SQL, spreadsheets and visualisation; owns dashboards and ad hoc analyses |
Data scientist |
Frames questions, runs experiments and builds statistical or machine learning models; communicates the findings |
Data engineer |
Builds and operates the pipelines, storage and quality checks that deliver trustworthy data |
Machine learning engineer |
Turns models into reliable services: packaging, serving, monitoring, retraining |
Research scientist |
Develops new methods; common in organisations that publish |
In a small team one person does all of this. That is the main reason this section covers the whole path rather than only modeling: the code you write for a model is a small part of the work, and most mistakes hide in the parts around it.
Python, R and SQL
Most day-to-day work uses one or more of three languages.
| Language | Strength | Where it is weaker |
|---|---|---|
SQL |
Declarative queries over data that already lives in a database; ubiquitous; the data is not copied out |
Not designed for statistics, iteration or machine learning; logic is hard to test |
Python |
One general-purpose language for data work, web services, automation and deep learning; a very large library ecosystem |
Statistical modeling output is less standardised than in R; several overlapping libraries to choose from |
R |
Statistics-first design, rich modeling and plotting packages, strong reporting tools |
Less common outside analysis; production integration usually takes more effort |
The choice is usually about the team and the surrounding system, not about technical capability. This section uses Python because it covers the whole path, including serving a model from a service such as the FastAPI data science serving page. Readers who prefer R will find the equivalent topics in the R guide, for example tidyverse and dplyr, ggplot2 and descriptive statistics and tests. The two languages can also call each other, as described on Python interop with reticulate. If you are new to Python itself, start with Getting Started in the Python guide.
SQL and Python are complements. Let the database do filtering and aggregation close to the data, and bring the reduced result into pandas for the steps that need Python. The database pages cover aggregate and window functions and choosing a database.
The following example asks the same question in SQL and in pandas, using only the standard library’s SQLite module for the database side, and checks that both agree.
import sqlite3
import pandas as pd
orders = pd.DataFrame({
"customer": ["ana", "ana", "bob", "bob", "bob", "eve"],
"amount": [20.0, 35.5, 12.0, 8.5, 30.0, 99.0],
})
# The same question asked in SQL (the database / data engineering view)...
with sqlite3.connect(":memory:") as con:
orders.to_sql("orders", con, index=False)
sql = pd.read_sql_query(
"SELECT customer, COUNT(*) AS n, ROUND(AVG(amount), 2) AS mean_amount "
"FROM orders GROUP BY customer ORDER BY mean_amount DESC", con)
print(sql)
# ...and in pandas (the analysis view), where the result feeds further steps
pandas_result = (orders.groupby("customer")["amount"]
.agg(n="count", mean_amount="mean")
.round(2)
.sort_values("mean_amount", ascending=False)
.reset_index())
print(pandas_result)
print(sql.equals(pandas_result.astype({"n": "int64"})))
Running it on Python 3.13 and pandas 3.1.0 prints the same three rows twice, and True at the end:
customer n mean_amount
0 eve 1 99.00
1 ana 2 27.75
2 bob 3 16.83
customer n mean_amount
0 eve 1 99.00
1 ana 2 27.75
2 bob 3 16.83
True
Source: pandas: DataFrame.groupby and Python: sqlite3
Common misconceptions
-
"Data science is machine learning." Modeling is one phase. Practitioners commonly report that acquiring, cleaning and understanding data takes more of the time than modeling, and the workflow page gives each phase its own place.
-
"More data always beats a better question." More rows reduce variance but not bias. If the data measures the wrong thing, or the sample leaves out the people you care about, a larger sample repeats the error with more confidence. See Ethics, Privacy & Responsible Data Use.
-
"A high accuracy means the model works." Accuracy on data the model has already seen, or on a test set that leaked into training, says nothing about new data. See Model Evaluation & Validation.
-
"Notebooks are the product." Notebooks are an excellent place to explore and explain. Results that must be repeated belong in scripts, tests and pipelines, as discussed on Jupyter Notebooks & JupyterLab.
-
"Deep learning replaces everything else." For tabular business data, simple models and gradient boosting are strong, cheap baselines. Deep learning is the next step for images, audio, text and very large problems, and is covered in the LLM foundations and Hugging Face sections.
Where older material is outdated
Books and tutorials from 2017 and earlier describe Python 2 or early Python 3, pandas below 1.0 and scikit-learn below 0.20. The ideas on this page have aged well. The code has not: expect print statements, .ix, DataFrame.append, sklearn.cross_validation and load_boston in old material, all of which are gone. The stack page summarises the changes that affect the whole ecosystem, and each sub-section has its own migration page.
Where to go next
-
Read The Data Science Workflow to see how a project is organised.
-
Read The Scientific Python Stack to learn which library does what.
-
Set up a working environment with Setting Up a Data Science Environment.