I was writing the following code to add two values from two different netcdf files.
import netCDF4 as nc m1 = nc.Dataset('m1.nc') m2 = nc.Dataset('m2.nc') a = m1.variables(['pr'] + m2.variables(['pr'] print a
This code gave me an parsing error - invalid syntax. I thought that since we can extract the values in these cells, I should be able to add them and assign them to a variable. Clearly, I am wrong, can someone explain why and how this mechanism works?