cython code for 2d histogram