Adds new code to data.py in gammapy/stats as missed out in previous commit