title: Python zero-size array to ufunc.reduce without identity
body: <p>I'm trying to make a histogram of some data that is being stored in an ndarray. The histogram is part of a set of analysis which I've made into a class in a python program. The part of the code that isn't working is below.</p>
  
  <pre><code>def histogram(self, iters):
      samples = T.MCMC(iters) #Returns an [iters,3,4] ndarray
      histAC = plt.figure(self.ip) #plt is matplotlib's pyplot
      self.ip+=1 #defined at the beginning of the class to start at 0
      for l in range(0,4):
          h = histAC.add_subplot(2,(iters+1)/2,l+1)
          for i in range(0,0.5*self.chan_num):
              intAvg = mean(samples[:,i,l])
              print intAvg
              for k in range(0,iters):
                  samples[k,i,l]=samples[k,i,l]-intAvg
              print "Samples is ",samples
              h.hist(samples,bins=5000,range=[-6e-9,6e-9],histtype='step')     
              h.legend(loc='upper right')
              h.set_title("AC Pulse Integral Histograms: "+str(l))
      figname = 'ACHistograms.png'
      figpath = 'plot'+str(self.ip)
      print "Finished!"
      #plt.savefig(figpath + figname, format = 'png')
  </code></pre>
  
  <p>This gives me the following error message:</p>
  
  <pre><code>File "johnmcmc.py", line 257, in histogram
    h.hist(samples,bins=5000,range=[-6e-9,6e-9],histtype='step') #removed label=apdlabel      
  File "/x/tsfit/local/lib/python2.6/site-packages/matplotlib/axes.py", line 7238, in hist
    ymin = np.amin(m[m!=0]) # filter out the 0 height bins
  File "/x/tsfit/local/lib/python2.6/site-packages/numpy/core/fromnumeric.py", line 1829, in amin
    return amin(axis, out)
  ValueError: zero-size array to ufunc.reduce without identity
  </code></pre>
  
  <p>The only search results I've found have been multiple copies of the same two conversations, from which the only thing I learned was that python histograms don't like getting fed empty arrays, which is why I added the print statement right above the line that's giving me trouble to  make sure the array isn't empty.</p>
  
  <p>Has anyone else come across this error before?</p>