h5netcdf.legacyapi.Dataset.createVariable#
- Dataset.createVariable(varname, datatype, dimensions=(), zlib=False, complevel=4, shuffle=True, fletcher32=False, chunksizes=None, fill_value=None, endian='native')#
Creates a new variable.
- Parameters:
varname (
str
) – Name of the new variable. If given as a path, intermediate groups will be created, if not existent.datatype (
numpy.dtype
,str
,UserType (Enum
,VL
,Compound)
) – Datatype of the new variable.dimensions (
tuple
) – Tuple containing dimension name strings. Defaults to empty tuple, effectively creating a scalar variable.zlib (
bool
, optional) – IfTrue
, variable data will be gzip compressed.complevel (
int
, optional) – Integer between 1 and 9 defining compression level. Defaults to 4. Ignored ifzlib=False
.shuffle (
bool
, optional) – IfTrue
, HDF5 shuffle filter will be applied. Defaults toTrue
. Ignored ifzlib=False
.fletcher32 (
bool
, optional) – IfTrue
, HDF5 Fletcher32 checksum algorithm is applied. Defaults toFalse
.chunksizes (
tuple
, optional) – Tuple of integers specifying the chunksizes of each variable dimension. Discussion onh5netcdf
chunksizes can be found in (GH52) and (PR127).fill_value (scalar, optional) – Specify
_FillValue
for uninitialized parts of the variable. Defaults toNone
.endian (
str
, optional) – Control on-disk storage format. Can be any oflittle
,big
ornative
(default).
- Returns:
var (
h5netcdf.legacyapi.Variable
) – Variable class instance