fix access to the binning in sample.py