cf.Data.dumpd

Data.dumpd()[source]

A dictionary serialization of the data array.

Returns :
out : dict

The serialization.

See also

loadd

Examples

>>> d = cf.Data([[1, 2, 3]], 'm')
>>> d.dumpd()
{'Partitions': [{'location': [(0, 1), (0, 3)],
                 'subarray': array([[1, 2, 3]])}],
 'Units': <CF Units: m>,
 '_axes': ['dim0', 'dim1'],
 '_pmshape': (),
 'dtype': dtype('int64'),
 'shape': (1, 3)}
>>> d.flip(1)
>>> d.transpose()
>>> d.Units *= 1000
>>> d.dumpd()
{'Partitions': [{'Units': <CF Units: m>,
                 'axes': ['dim0', 'dim1'],
                 'location': [(0, 3), (0, 1)],
                 'subarray': array([[1, 2, 3]])}],
 'Units': <CF Units: 1000 m>,
 '_axes': ['dim1', 'dim0'],
 '_flip': ['dim1'],
 '_pmshape': (),
 'dtype': dtype('int64'),
 'shape': (3, 1)}
>>> d.dumpd()
{'Partitions': [{'Units': <CF Units: m>,
                 'location': [(0, 1), (0, 3)],
                 'subarray': array([[1, 2, 3]])}],
 'Units': <CF Units: 1000 m>,
 '_axes': ['dim0', 'dim1'],
 '_flip': ['dim1'],
 '_pmshape': (),
 'dtype': dtype('int64'),
 'shape': (1, 3)}
>>> e = cf.Data(loadd=d.dumpd())
>>> e.equals(d)
True

Previous topic

cf.Data.dump

Next topic

cf.Data.equals

This Page