title: Python : Replacing Values in netcdf file using netCDF4
body: <p>I have a netcdf file with several values &lt; 0. I would like to replace all of them with a single value (say -1). How do I do that using netCDF4? I am reading in the file like this:</p>
  
  <pre><code>import netCDF4
  
  dset      = netCDF4.Dataset('test.nc')
  dset[dset.variables['var'] &lt; 0] = -1
  </code></pre>