scipy.io.netcdf_file.createVariable

netcdf_file.createVariable(name, type, dimensions)[源代码]

为创建一个空变量 netcdf_file 对象,并指定其数据类型和使用的维度。

参数
name应力

新变量的名称。

type数据类型或字符串

变量的数据类型。

dimensions字符串序列

变量使用的维名称列表,按所需顺序排列。

退货
variablenetcdf_variable

新创建的 netcdf_variable 对象。此对象也已添加到 netcdf_file 对象也是如此。

注意事项

变量要使用的任何维都应已存在于NetCDF数据结构中,或应由创建 createDimension 在创建NetCDF变量之前。