File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -385,17 +385,17 @@ def compute_diagnostic(filename):
385385> {: .solution}
386386{: .challenge}
387387
388- > # # Reading data using Scipy's netCDF library
388+ > # # Reading data using the netCDF4 package
389389>
390390> Yet another option to read the NetCDF file data is to use
391- > the [SciPy ' s netCDF library][ netCDF] .
391+ > the [netCDF- 4 Python interface](https: // unidata.github.io / netcdf4 - python / ) to the netCDF C library .
392392>
393393>> # # Answer
394394>>
395- >> First, import the `` netcdfx `` package at the top of the script as :
395+ >> First, import the `` netCDF4 `` package at the top of the script as :
396396>>
397397>>~~~ python
398- >> from scipy.io import netcdfx
398+ >> import netCDF4
399399>>~~~
400400>>
401401>> Then, change `` compute_diagnostic`` as :
@@ -404,7 +404,7 @@ def compute_diagnostic(filename):
404404>> def compute_diagnostic (filename ):
405405>> """ Compute an example diagnostic."""
406406>> logger.debug(" Loading %s " , filename)
407- >> netcdf_file = netcdf.netcdf_file (filename,' r' )
407+ >> nc_data = netCDF4.Dataset (filename,' r' )
408408>>
409409>> # do your analyses on the data here
410410>>
You can’t perform that action at this time.
0 commit comments