Insert a new data array into the field in place.
Note that the data array’s missing data value, if it has one, is not transferred to the field.
Parameters : |
|
---|---|
Returns : | None |
Examples
>>> f.dimension_sizes
{'dim0': 1, 'dim1': 3}
>>> f.insert_data(cf.Data([[0, 1, 2]]))
>>> f.dimension_sizes
{'dim0': 1, 'dim1': 3}
>>> f.insert_data(cf.Data([[0, 1, 2]]), axes=['dim0', 'dim1'])
>>> f.dimension_sizes
{}
>>> f.insert_data(cf.Data([[0, 1], [2, 3, 4]]))
>>> f.dimension_sizes
{'dim0': 2, 'dim1': 3}
>>> f.insert_data(cf.Data(4))
>>> f.insert_data(cf.Data(4), axes=[])
>>> f.dimension_sizes
{'dim0': 3, 'dim1': 2}
>>> data = cf.Data([[0, 1], [2, 3, 4]])
>>> f.insert_data(data, axes=['dim1', 'dim0'], copy=False)
>>> f.insert_data(cf.Data([0, 1, 2]))
>>> f.insert_data(cf.Data([3, 4, 5]), replace=False)
ValueError: Can't initialize data: Data already exists
>>> f.insert_data(cf.Data([3, 4, 5]))