title: Getting the position of a value inside a dataset that has three 1D numpy arrays
body: <p>I have a dataset <code>precip_subset</code> that has three 1D numpy arrays. I merged 31 datasets to create <code>precip_subset</code>: the first numpy arrray in the dataset represents the day, the 2nd array represents the longitude, and the thrid array represents the latitude. There is a unique value for precipitation at each position in the dataset; for example, <code>print(precip_subset[1, 0, 21])</code> will give me a value of <code>1.05</code>. </p>
  
  <p>In <code>precip_subset</code>, I only wanted specific values of precipitation. So I confined the dataset like so:</p>
  
  <pre><code> data_low = precip_subset[(precip_subset &gt; 0) &amp; (precip_subset &lt; 3.86667)]
  </code></pre>
  
  <p>Following this, I tried to do this:</p>
  
  <pre><code>for val in data_low:
      if val &lt; 1:
          print(precip_subset.tolist().index(val))
  </code></pre>
  
  <p>What I am trying to do is get the position of the value in the original dataset, <code>precip_subset</code>. However, I get an error of <code>The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()</code>. Can anyone explain how I can get the position of a value from the <code>precip_subset</code>?</p>
  
  <p>EDIT: Here is how precip_subset was created:</p>
  
  <pre><code>from netCDF4 import Dataset
  import numpy as np
  import matplotlib.pyplot as plt
  from mpl_toolkits.basemap import Basemap
  
  data_path = r"C:\Users\matth\Downloads\TRMM_3B42RT\3B42RT_Daily.201001.7.nc4"
  f = Dataset(data_path)
  
  latbounds = [ -31 , -19 ]
  lonbounds = [ 131, 146 ] # 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 ]
  </code></pre>
  
  <p>The variable "precipitation" is from the original dataset <code>r"C:\Users\matth\Downloads\TRMM_3B42RT\3B42RT_Daily.201001.7.nc4"</code></p>
  
  <p>Also, the shape and size of precip_subset respectively is <code>(31, 60, 48)</code> and <code>89280</code></p>