title: NumPy Histogram - ValueError range parameter must be finite - input array is okay
body: <p>I'm struggling to understand this error, since I'll give you an example that's working and the one I'm interested in that's <em>not</em>.</p>
  
  <p>I have to analyse a set of data with hourly prices for an entire year in it, called <code>sys_prices</code>, which - after various transformations - is a <code>numpy.ndarray</code> object with 8785 rows (1 column), and every row is a <code>numpy.ndarray</code> item with only one element, a <code>numpy.float64</code> number.</p>
  
  <p>The code <strong>not</strong> working is the following:</p>
  
  <pre><code>stop_day = 95
  start_day = stop_day - 10 # 10 days before
  stop_day = (stop_day-1)*24
  start_day = (start_day-1)*24
  
  pcs=[] # list of prices to analyse
  for ii in range(start_day, stop_day):
      pcs.append(sys_prices[ii][0])
  
  p, x = np.histogram(pcs, bins='fd') 
  </code></pre>
  
  <p>The <code>*24</code> part is to tune the index within the dataset so that to respect the hourly resolution.</p>
  
  <p>What I expect is to supply the list <code>pcs</code> to the <em>histogram</em> method, so that to get the values of my histogram and bin edges into <em>p</em> and <em>x</em>, respectively.  </p>
  
  <p>I say that I expect this because the following code <strong>works</strong>:</p>
  
  <pre><code>start_day = 1 
  start_month = 1 
  start_year = 2016 
  stop_day = 1
  stop_month = 2 
  stop_year = 2016
  num_prices = (date(stop_year, stop_month, stop_day) - date(start_year, start_month, start_day)).days*24
  
  jan_prices = []
  for ii in range(num_prices):
      jan_prices.append(sys_prices[ii][0])
  
  p, x = np.histogram(jan_prices, bins='fd') # bin the data`
  </code></pre>
  
  <p>The difference in the codes is that the working one is analyzing only 10 days within an arbitrary period starting backwards from a chosen day of the year, while the working example uses all the prices in the month of January (eg. the first 744 values of the dataset).</p>
  
  <p><strong>Strange(r) thing:</strong> I used different values for <code>stop_day</code>, and it seems that 95 raises the error, while 99 or 100 or 200 <em>don't</em>.</p>
  
  <p>Could you help me?</p>