cfdm.core.Constructs.items¶
-
Constructs.
items
()[source]¶ Return the items as (construct key, construct) pairs.
New in version (cfdm): 1.7.0
- Returns
dict_items
The construct key and constructs respectively as key-value pairs in a Python
dict_items
iterator.
Examples
>>> f = cfdm.core.example_field(0) >>> c = f.constructs >>> c_items = c.items() >>> print(c_items) dict_items([('dimensioncoordinate0', <DimensionCoordinate: latitude(5) degrees_north>), ('dimensioncoordinate1', <DimensionCoordinate: longitude(8) degrees_east>), ('dimensioncoordinate2', <DimensionCoordinate: time(1) days since 2018-12-01 >), ('domainaxis0', <DomainAxis: size(5)>), ('domainaxis1', <DomainAxis: size(8)>), ('domainaxis2', <DomainAxis: size(1)>), ('cellmethod0', <CellMethod: area: mean>)]) >>> type(c_items) <class 'dict_items'> >>> dict(c_items) {'dimensioncoordinate0': <DimensionCoordinate: latitude(5) degrees_north>, 'dimensioncoordinate1': <DimensionCoordinate: longitude(8) degrees_east>, 'dimensioncoordinate2': <DimensionCoordinate: time(1) days since 2018-12-01 >, 'cellmethod0': <CellMethod: area: mean>, 'domainaxis0': <DomainAxis: size(5)>, 'domainaxis1': <DomainAxis: size(8)>, 'domainaxis2': <DomainAxis: size(1)>}