cf.Data.dumpd¶
-
Data.
dumpd
()[source]¶ Return a serialization of the data array.
The serialization may be used to reconstruct the data array as it was at the time of the serialization creation.
See also
Examples 1: >>> s = d.dumpd()
Returns: - out:
dict
The serialization.
Examples: >>> d = cf.Data([[1, 2, 3]], 'm') >>> d.dumpd() {'Partitions': [{'location': [(0, 1), (0, 3)], 'subarray': array([[1, 2, 3]])}], 'units': 'm', '_axes': ['dim0', 'dim1'], '_pmshape': (), 'dtype': dtype('int64'), 'shape': (1, 3)}
>>> d.flip(1) >>> d.transpose() >>> d.Units *= 1000 >>> d.dumpd() {'Partitions': [{'units': 'm', 'axes': ['dim0', 'dim1'], 'location': [(0, 3), (0, 1)], 'subarray': array([[1, 2, 3]])}], ` 'units': '1000 m', '_axes': ['dim1', 'dim0'], '_flip': ['dim1'], '_pmshape': (), 'dtype': dtype('int64'), 'shape': (3, 1)}
>>> d.dumpd() {'Partitions': [{'units': 'm', 'location': [(0, 1), (0, 3)], 'subarray': array([[1, 2, 3]])}], 'units': '10000 m', '_axes': ['dim0', 'dim1'], '_flip': ['dim1'], '_pmshape': (), 'dtype': dtype('int64'), 'shape': (1, 3)}
>>> e = cf.Data(loadd=d.dumpd()) >>> e.equals(d) True
- out: