title: How to print values of a 3 dimensional array that are less than a specific value?
body: <p>so I have a dataset named data_low that looks like this:</p>
  
  <pre><code>(array([ 0,  0,  0, ..., 30, 30, 30]), array([  2,   2,   5, ..., 199, 199, 199]), array([113, 114,  64, ...,  93,  94,  96]))
  </code></pre>
  
  <p>And this is its shape: (84243,3).</p>
  
  <p>I can get a unique value for precipitation from the dataset like this:</p>
  
  <pre><code>In [63]: print(data_low[0, 2, 113])
  Out [63]: 1.74
  </code></pre>
  
  <p>What I am trying to do is print all the values in my dataset that have a value of less than 3.86667. I'm pretty new to python, and don't really know which loop to use in order to this. Help is much appreciated. Thanks.</p>
  
  <p>EDIT: Here is the program I currently have. For some context, I used ncecat to combine 31 datasets, so that is why I have three 1D arrays: the first array is the day, and the 2nd and 3rd represent longitude and latitude.</p>
  
  <pre><code>data_path = r"C:\Users\matth\Downloads\TRMM_3B42RT\3B42RT_Daily.201001.7.nc4"
  f = Dataset(data_path)
  
  latbounds = [ -38 , -20 ]
  lonbounds = [ 115 , 145 ] # degrees east ? 
  lats = f.variables['lat'][:] 
  lons = f.variables['lon'][:]
  
  # latitude lower and upper index
  latli = np.argmin( np.abs( lats - latbounds[0] ) )
  latui = np.argmin( np.abs( lats - latbounds[1] ) ) 
  
  # longitude lower and upper index
  lonli = np.argmin( np.abs( lons - lonbounds[0] ) )
  lonui = np.argmin( np.abs( lons - lonbounds[1] ) )
  
  precip_subset = f.variables['precipitation'][ : , lonli:lonui , latli:latui ]
  
  print(precip_subset.shape)
  print(precip_subset.size)
  print(np.mean(precip_subset))
  
  data_low = np.nonzero((precip_subset &gt; 0) &amp; (precip_subset &lt; 3.86667))
  print(data_low)
  
  x = list(zip(*data_low))[:]
  xx = np.array(x)
  print(xx.shape)
  print(xx.size)
  
  for i in range(0,84243,1):
      print(data_low[i, i, i])
  </code></pre>
  
  <p>OUT:</p>
  
  <pre><code>In [136]: %run "C:\Users\matth\precip_anomalies.py"
  (31, 120, 72)
  267840
  1.51398
  (array([ 0,  0,  0, ..., 30, 30, 30]), array([  7,   7,   7, ..., 119, 119, 
  119]), array([ 9, 10, 11, ..., 23, 53, 54]))
  (13982, 3)
  41946
  [ 0  0  0 ..., 30 30 30]
  
  TypeErrorTraceback (most recent call last)
  C:\Users\matth\precip_anomalies.py in &lt;module&gt;()
       53 
       54 for i in range(0,84243,1):
  ---&gt; 55     print(data_low[i, i, i])
  
  TypeError: tuple indices must be integers, not tuple
  </code></pre>