netcdf read

jorge.conrado at cptec.inpe.br jorge.conrado at cptec.inpe.br
Tue Sep 1 13:23:34 EDT 2015


Hi,


I'm starting in the Python scripts. I run this script:


import numpy as np

import netCDF4

f = netCDF4.Dataset('uwnd.mon.ltm.nc','r')


f.variables


and I had the message:


netcdf4.py
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
NameError: name 'netcdf4' is not defined


What can I do to solve this.



I typed  this three lines:


import netCD4

f = netCDF4.Dataset('uwnd.mon.ltm.nc','r')


f.variables


and it work.


Please, why my script didn't work.


Conrado





More information about the Python-list mailing list