carpentries-lab / python-aos-lesson

Python for Atmosphere and Ocean Scientists
https://carpentries-lab.github.io/python-aos-lesson/
Other
87 stars 49 forks source link

clim.units results in attribute error #13

Closed laufers closed 5 years ago

laufers commented 5 years ago

When working on the second episode, when I get to change the units for the precip data, I get the following error.

AttributeError: cannot set attribute 'units' on a 'DataArray' object. Use setitem style assignment (e.g., ds['name'] = ...) instead to assign variables.

laufers commented 5 years ago

I got clim.attrs['units'] = 'mm/day' to work.

laufers commented 5 years ago

OK, now I see that the later code does make use of the .attrs naming where you reverse the color index. So need to fix the typo in the previous code box. s

DamienIrving commented 5 years ago

Thanks for spotting this typo, @laufers! Much appreciated.