title: Why is binned_statistic_2d now throwing TypeError?
body: <p>I have been using scipy's binned_statistic_2d function to plot a 2d histogram of some data, particularly to return a list of the index of which bin the data is in, by setting the expand_binnumbers = True. It was working perfectly, until today. The following code demonstrates my problem:</p>
  
  <pre><code>import numpy as np
  from scipy.stats import binned_statistic_2d as hist 
  
  # my data is two arrays of numbers 
  x = np.random.random((5,))
  y = np.random.random((5,))
  
  # I need to know which bin the values are in so I return the bin_idx
  data = hist(x,y, bins = [2,2], statistic = 'count', values = None, expand_binnumbers = True)
  
  bin_idx = data[3]
  </code></pre>
  
  <blockquote>
    <p>TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''</p>
  </blockquote>
  
  <p>Any ideas why this should suddenly stop working? </p>