Privacy note: We capture your IP address to provide customised and focused services. See our Privacy Policy.

Data Science & Statistics with Python — Alpha School

Lesson 17: Data Ethics, Privacy and Reproducibility

Data about people is powerful, and power needs rules. Data ethics asks whether the collection and use of data is fair, responsible and transparent — not merely whether it is legal. A company may legally collect your location from an app you installed, but secretly selling it to an insurer would still be unethical, because you did not agree to that use and it could harm you. The law sets a floor; ethics asks for more.

Four principles cover most cases. Consent means people understand what is collected and agree to it — genuinely, not through a wall of legal text nobody reads. Minimisation means collecting only what you need: if the question does not require names, do not collect them. Security means protecting what you hold, with access controls and care. And accountability means someone is responsible when things go wrong, with a way for affected people to complain and be heard. If your project cannot meet these four, it should not collect the data.

Privacy in Practice

Privacy is protected by design, not by hope. Remove names and other direct identifiers before analysis, and remember that indirect details can identify someone too: a rare combination of age, school and postcode can single out one student even with the name removed. This is why the course's own platform collects no accounts and no personal data, and why your capstone should avoid data about identifiable people unless you have thought carefully about consent. When in doubt, use public data about things rather than private data about people.

There is also the question of who benefits and who is harmed. A dataset of past hiring decisions will reflect past biases, and a model trained on it will repeat them. A survey that only reaches one group will speak for that group as if it spoke for everyone. Ethical data science means asking, at the start, whose data this is, who could be hurt by its use, and whether the people it describes would agree to how it is used.

Reproducibility: Ethics Towards the Truth

Reproducibility is also an ethical matter. An analysis that cannot be repeated cannot be checked, and an unchecked analysis can mislead decisions that affect real people. Keep the raw data untouched, keep a script of every step from raw data to result, record the versions of the tools you used, and write down your decisions. Someone else — or you, in six months — should be able to rerun your work and get the same answer. That is not bureaucracy; it is the difference between a finding and a story.

Who Owns the Data?

Data about people raises a question that technical rules cannot settle: who owns it? The person it describes, the organisation that collected it, or the public that benefits from its analysis? Different countries answer differently, and the law is still catching up with the technology. But the ethical direction is clear: people should know what is collected about them, should be able to see it and correct it, and should be able to say no to uses they did not agree to. A project that treats people's data as if it belonged to the collector has already made an ethical choice, whether it admits it or not.

This matters for your own work as well. When you use a public dataset about people, you inherit the decisions of whoever collected it — including any unfairness in how it was gathered. Read the documentation, ask who is missing, and consider whether your analysis could harm the people it describes. If the answer is unclear, choose a different dataset. There are many questions worth answering that do not require data about identifiable people, and the capstone is a good place to practise choosing them.

Consent in Practice

Real consent is harder than a tick box. It means the person understands what will be collected, why it is needed, how long it will be kept, and who will see it — in language they can actually understand, at the moment they are asked. Long legal documents that nobody reads do not create consent; they create the appearance of it. A good test is whether the person could explain back to you, in their own words, what they agreed to. If they could not, the consent is not informed, however many boxes were ticked. For a school project, that means asking people directly, explaining the purpose plainly, and accepting that some will say no — and that their no must be respected.

Key Terms

Data ethics
Whether the collection and use of data is fair, responsible and transparent — beyond merely legal.
Consent
People understanding what data is collected and agreeing to it, genuinely and informed.
Data minimisation
Collecting only the data genuinely needed for the question.
De-identification
Removing names and other direct identifiers before analysis.
Re-identification
Singling out a person from supposedly anonymous data, using combinations of details.
Reproducibility
Being able to repeat an analysis exactly and get the same result.

Discussion Questions

  1. A company legally collects your location. When would selling it still be unethical?
  2. A dataset has no names, but each student is identified by age, school and postcode. Is that anonymous? Why?
  3. Why is reproducibility an ethical issue, not just a technical one?

Practice Questions

  1. What is the difference between legal and ethical data use?
  2. What are the four principles of ethical data handling in this lesson?
  3. What is data minimisation?
  4. Why can removing names fail to protect privacy?
  5. What should a reproducible analysis include?
Show answers
  1. The law sets a floor; ethics asks for more. Something can be legal — such as collecting location data an app user agreed to — and still be unethical if it is used in a way they did not agree to and that could harm them.
  2. Consent, minimisation, security and accountability.
  3. Collecting only the data genuinely needed for the question — for example, not collecting names if the question does not require them.
  4. Because combinations of indirect details — such as a rare age, school and postcode — can single out one person even with the name removed. That is re-identification.
  5. The untouched raw data, a script of every step from raw data to result, the versions of the tools used, and a record of the decisions made.
Keep reading to complete this lesson