cf.Partition.change_axis_names

Partition.change_axis_names(dim_name_map)[source]

Change the axis names.

The dimension names are arbitrary, so mapping them to another arbitrary collection does not change the data array values, units, dimension directions nor dimension order.

Parameters :dim_name_map : dict
Returns :None

Examples

>>> p._dimensions
['dim0', 'dim1']
>>> p._directions
{'dim0': True, 'dim1': False}
>>> p.change_axis_names({'dim0': 'dim2', 'dim1': 'dim0'})
>>> p._dimensions
['dim2', 'dim0']
>>> p._directions
{'dim2': True, 'dim0': False}
>>> p._dimensions
['dim0', 'dim1']
>>> p._directions
{'dim0': True, 'dim1': False}
>>> p.change_axis_names({'dim0': 'dim1'})
>>> p._dimensions
['dim1', 'dim2']
>>> p._directions
{'dim1': True, 'dim2': False}

Previous topic

cf.Partition.on_disk

Next topic

cf.Partition.close

This Page