Demonstrating Neighbouring Datasets and Query Changes in Python
P. K. Majumdar · Zenodo (CERN European Organization for Nuclear Research) · 2026
This Python example uses ten fictional records to demonstrate add/remove and replace-one adjacency. It creates one neighbouring dataset by removing an individual's record and another by replacing that record. It then compares dataset sizes, counts of individuals over 40, and two-category age histograms. The results illustrate how a single-record change affects statistical outputs and introduce the concept of query sensitivity. The code releases exact statistics; it demonstrates the foundations of differential privacy but does not itself provide privacy protection.