title: Return the value of a 2D PDF given x and y in Python?
body: <p>I have some data that I plotted the PDF using matplotlib's hist2D function.
  The result looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/Yj83S.png" alt="enter image description here"></p>
  
  <p>The hist2d function returns a triple of arrays: H,xedges,yedges. H being the 2D histogram value.
  Now I'd like to turn this discrete H matrix and turn it into a function, that returns the value of H for any given (x,y) input. 
  In other words I'd like to turn my 2D histogram into a 2D step function. Is there a specific function that would be computationally cheap that I could use on that purpose?</p>
  
  <p>This looks like a pretty simple operation (usually done for image processing but with pixel indices instead of real numbers) but I'm unable to find anything about it, can you please help me?</p>