title: Numpy digitize error: object of too small depth for desired array
body: <p>I have a masked array data, and I want to digitize to check the median data for each bins.
  So I tried to use below codes</p>
  
  <pre><code>bin_num1 = 5
  
  bins1 = np.linspace(min(np.log10(data['vdisp'])), max(np.log10(data['vdisp'])), bin_num1)
  delta1 = bins1[1] - bins1[0]
  idx1 = np.digitize(data['vdisp'], bin_num1, right = True)
  
  running_med1 = [np.median(np.log10(prim_data['stellar_mass'])[idx1 == k]) for k in range(bin_num1)]
  
  ax13.scatter(bins1 - delta1 / 2, running_med1, color = 'magenta')
  </code></pre>
  
  <p>However, I got the error</p>
  
  <pre><code>idx1 = np.digitize(data['vdisp'], bin_num1, right = True)
  File '/home/user/anaconda3/lib/python3.6/site-packages/numpy/lib/function_base.py', line 4799, in digitize
  mono = _monotonicity(bins)
  ValueError: object of too small depth for desired array
  </code></pre>
  
  <p>How can I solve this problem??</p>
  
  <p>I've already tried data['vdisp'].all() or .any()</p>
  
  <p>Thanks for your help!</p>