How to save a vector into NetCDF?

Thanks for the reply, and the useful information! I’m able to figure it out myself. Below was how I did it:

defDim(ds, "year",  18);
v1 = defVar(ds, "year", Int64, ("year", ));
v1[:] = D;

The trick is the magic comma. Without it, it won’t work.

2 Likes