cfdm.NetCDFArray.get_groups

NetCDFArray.get_groups(address)[source]

The netCDF4 group structure of a netCDF variable.

New in version (cfdm): 1.8.6.0

Parameters
address: str or int

The netCDF variable name, or integer varid, from which to get the groups.

New in version (cfdm): 1.10.1.0

Returns
(list, str) or (list, int)

The group structure and the name within the group. If address is a varid then an empty list and the varid are returned.

Examples

>>> n.get_groups('tas')
([], 'tas')
>>> n.get_groups('/tas')
([], 'tas')
>>> n.get_groups('/data/model/tas')
(['data', 'model'], 'tas')
>>> n.get_groups(9)
([], 9)