cf.Field.insert_axis¶
-
Field.
insert_axis
(axis, key=None, replace=True)[source]¶ Insert a domain axis into the field.
See also
insert_aux
,insert_measure
,insert_ref
,insert_data
,insert_dim
Parameters: - axis:
cf.DomainAxis
The new domain axis.
- key:
str
, optional The identifier for the new axis. By default a new, unique identifier is generated.
- replace:
bool
, optional If False then do not replace an existing axis with the same identifier but a different size. By default an existing axis with the same identifier is changed to have the new size.
Returns: - out:
str
The identifier of the new domain axis.
Examples: >>> f.insert_axis(cf.DomainAxis(1)) >>> f.insert_axis(cf.DomainAxis(90), key='dim4') >>> f.insert_axis(cf.DomainAxis(23), key='dim0', replace=False)
- axis: