Data Science Reproducibility
Keep source identity and analysis settings with the result.
How it works
Reproducibility means that a stated procedure can be rerun with its specified inputs and environment. Record source hashes, package versions, collection boundaries and configuration. A random seed is one part of that record, not a guarantee of identical results across every library version or numerical backend. Preserve raw data and generate derived results into separate outputs.
Run the code
Try in playground opens the correct python editor and preloads the complete source. Choose Run to execute; loading does not execute it. The isolated browser runtime does not read personal PC files.
Local review: Python 3.12.14, NumPy 2.5.4, Pandas 3.0.6 and SciPy 1.18.0. Browser review: Pyodide 0.27.7, Python 3.12.7, NumPy 2.0.2, Pandas 2.2.3 and SciPy 1.14.1 in their respective editors. Save the download as reproducibility.py and run python reproducibility.py in your separate environment. Apache and MySQL are not needed. Environment setup.
Example
import hashlib
import json
source = b"day,litres\n2026-05-04,18\n"
manifest = {"input_sha256": hashlib.sha256(source).hexdigest(), "observation": "opening day", "metric": "MAE", "seed": 31}
encoded = json.dumps(manifest, sort_keys=True)
assert json.loads(encoded)["input_sha256"] == hashlib.sha256(source).hexdigest()
assert hashlib.sha256(source+b"\n").hexdigest() != manifest["input_sha256"]
print("Input hash and analysis settings recorded")
Expected result
Input hash and analysis settings recorded
The digest identifies exact bytes, including line endings, rather than proving the source is truthful. Keep the manifest alongside the script and output so a changed input is visible. For real projects, record dependencies and code revision too. A reconstructed dataset with the same totals may still have different rows and need a new review.
Technical references: NumPy, Pandas and SciPy. For evaluation design see the scikit-learn guide to leakage; these examples do not require scikit-learn.